cc-viewer 0.1.1 → 0.1.2

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.
package/lib/style.css DELETED
@@ -1,824 +0,0 @@
1
- * { margin: 0; padding: 0; box-sizing: border-box; }
2
- body {
3
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
4
- background: #0a0a0a;
5
- color: #e5e7eb;
6
- height: 100vh;
7
- overflow: hidden;
8
- display: flex;
9
- flex-direction: column;
10
- }
11
- .header {
12
- background: #111;
13
- padding: 0 24px;
14
- height: 60px;
15
- box-shadow: 0 1px 3px rgba(0,0,0,0.5);
16
- display: flex;
17
- align-items: center;
18
- justify-content: space-between;
19
- flex-shrink: 0;
20
- border-bottom: 1px solid #1f1f1f;
21
- }
22
- .header-left {
23
- display: flex;
24
- align-items: center;
25
- gap: 16px;
26
- }
27
- h1 {
28
- color: #fff;
29
- font-size: 18px;
30
- font-weight: 600;
31
- }
32
- .status-badge {
33
- display: inline-flex;
34
- align-items: center;
35
- gap: 6px;
36
- padding: 4px 12px;
37
- background: #064e3b;
38
- border: 1px solid #065f46;
39
- border-radius: 12px;
40
- font-size: 12px;
41
- color: #6ee7b7;
42
- }
43
- .status-dot {
44
- width: 6px;
45
- height: 6px;
46
- border-radius: 50%;
47
- background: #10b981;
48
- animation: pulse 2s infinite;
49
- }
50
- @keyframes pulse {
51
- 0%, 100% { opacity: 1; }
52
- 50% { opacity: 0.5; }
53
- }
54
- .header-right {
55
- display: flex;
56
- align-items: center;
57
- gap: 16px;
58
- }
59
- .stat-badge {
60
- padding: 6px 12px;
61
- background: #1a1a1a;
62
- border-radius: 6px;
63
- font-size: 13px;
64
- color: #9ca3af;
65
- border: 1px solid #2a2a2a;
66
- }
67
- .stat-badge strong {
68
- color: #fff;
69
- margin-left: 4px;
70
- }
71
- button {
72
- background: #1a1a1a;
73
- color: #e5e7eb;
74
- border: 1px solid #2a2a2a;
75
- padding: 8px 16px;
76
- border-radius: 6px;
77
- cursor: pointer;
78
- font-size: 13px;
79
- font-weight: 500;
80
- transition: all 0.2s;
81
- }
82
- button:hover {
83
- background: #2a2a2a;
84
- border-color: #3a3a3a;
85
- }
86
- .main-container {
87
- display: flex;
88
- flex: 1;
89
- overflow: hidden;
90
- position: relative;
91
- }
92
- .left-panel {
93
- width: 450px;
94
- min-width: 250px;
95
- max-width: 800px;
96
- background: #111;
97
- border-right: 1px solid #1f1f1f;
98
- display: flex;
99
- flex-direction: column;
100
- flex-shrink: 0;
101
- }
102
- .resizer {
103
- width: 4px;
104
- background: #1f1f1f;
105
- cursor: col-resize;
106
- flex-shrink: 0;
107
- position: relative;
108
- transition: background 0.2s;
109
- z-index: 10;
110
- }
111
- .resizer:hover {
112
- background: #3b82f6;
113
- }
114
- .resizer::before {
115
- content: '';
116
- position: absolute;
117
- top: 0;
118
- left: -3px;
119
- right: -3px;
120
- bottom: 0;
121
- }
122
- .panel-header {
123
- padding: 16px 20px;
124
- border-bottom: 1px solid #1f1f1f;
125
- font-weight: 600;
126
- font-size: 14px;
127
- color: #fff;
128
- }
129
- .request-list {
130
- flex: 1;
131
- overflow-y: auto;
132
- padding: 12px;
133
- }
134
- .request-item {
135
- background: #1a1a1a;
136
- border: 1px solid #2a2a2a;
137
- border-radius: 6px;
138
- padding: 14px 16px;
139
- margin-bottom: 8px;
140
- cursor: pointer;
141
- transition: all 0.2s;
142
- }
143
- .request-item:hover {
144
- border-color: #3b82f6;
145
- background: #1f1f1f;
146
- }
147
- .request-item.active {
148
- border-color: #3b82f6;
149
- background: #1a2332;
150
- }
151
- .request-item-header {
152
- display: flex;
153
- justify-content: space-between;
154
- align-items: center;
155
- margin-bottom: 10px;
156
- }
157
- .method {
158
- display: inline-block;
159
- padding: 4px 10px;
160
- border-radius: 4px;
161
- font-size: 11px;
162
- font-weight: 600;
163
- background: #3b82f6;
164
- color: white;
165
- text-transform: uppercase;
166
- }
167
- .method.POST { background: #10b981; }
168
- .method.PUT { background: #f59e0b; }
169
- .method.DELETE { background: #ef4444; }
170
-
171
- .request-item.main-agent {
172
- border-left: 3px solid #f59e0b;
173
- }
174
-
175
- .agent-badge {
176
- display: inline-block;
177
- padding: 2px 6px;
178
- border-radius: 3px;
179
- font-size: 10px;
180
- font-weight: 600;
181
- text-transform: uppercase;
182
- letter-spacing: 0.5px;
183
- }
184
-
185
- .agent-badge.main {
186
- background: rgba(245, 158, 11, 0.15);
187
- color: #f59e0b;
188
- border: 1px solid rgba(245, 158, 11, 0.3);
189
- }
190
-
191
- .agent-badge.sub {
192
- background: rgba(107, 114, 128, 0.15);
193
- color: #6b7280;
194
- border: 1px solid rgba(107, 114, 128, 0.2);
195
- }
196
-
197
- .timestamp {
198
- font-size: 12px;
199
- color: #6b7280;
200
- }
201
- .url-preview {
202
- color: #60a5fa;
203
- font-size: 13px;
204
- white-space: nowrap;
205
- overflow: hidden;
206
- text-overflow: ellipsis;
207
- font-family: 'Monaco', 'Consolas', monospace;
208
- }
209
- .request-meta {
210
- display: flex;
211
- gap: 12px;
212
- margin-top: 8px;
213
- font-size: 12px;
214
- color: #6b7280;
215
- }
216
- .right-panel {
217
- flex: 1;
218
- background: #111;
219
- border-left: 1px solid #1f1f1f;
220
- display: flex;
221
- flex-direction: column;
222
- overflow: hidden;
223
- min-width: 0;
224
- }
225
- .detail-header {
226
- padding: 20px 24px;
227
- border-bottom: 1px solid #1f1f1f;
228
- }
229
- .detail-url {
230
- color: #60a5fa;
231
- font-size: 15px;
232
- font-weight: 500;
233
- word-break: break-all;
234
- margin-bottom: 12px;
235
- font-family: 'Monaco', 'Consolas', monospace;
236
- }
237
- .detail-meta {
238
- display: flex;
239
- gap: 20px;
240
- font-size: 13px;
241
- color: #9ca3af;
242
- flex-wrap: wrap;
243
- }
244
- .detail-meta-item {
245
- display: flex;
246
- align-items: center;
247
- gap: 6px;
248
- }
249
- .status-success { color: #10b981; font-weight: 600; }
250
- .status-error { color: #ef4444; font-weight: 600; }
251
- .tabs {
252
- display: flex;
253
- border-bottom: 1px solid #1f1f1f;
254
- padding: 0 24px;
255
- background: #0f0f0f;
256
- }
257
- .tab {
258
- padding: 12px 20px;
259
- cursor: pointer;
260
- font-size: 14px;
261
- font-weight: 500;
262
- color: #9ca3af;
263
- border-bottom: 2px solid transparent;
264
- transition: all 0.2s;
265
- position: relative;
266
- top: 1px;
267
- }
268
- .tab:hover {
269
- color: #3b82f6;
270
- }
271
- .tab.active {
272
- color: #3b82f6;
273
- border-bottom-color: #3b82f6;
274
- }
275
- .tab-content {
276
- flex: 1;
277
- overflow-y: auto;
278
- padding: 24px;
279
- }
280
- .tab-pane {
281
- display: none;
282
- }
283
- .tab-pane.active {
284
- display: block;
285
- }
286
- .info-section {
287
- margin-bottom: 24px;
288
- }
289
- .info-title {
290
- font-size: 13px;
291
- font-weight: 600;
292
- color: #e5e7eb;
293
- margin-bottom: 12px;
294
- text-transform: uppercase;
295
- letter-spacing: 0.5px;
296
- }
297
- .info-title.collapsible {
298
- cursor: pointer;
299
- user-select: none;
300
- transition: color 0.2s;
301
- }
302
- .info-title.collapsible:hover {
303
- color: #fff;
304
- }
305
- .info-table {
306
- width: 100%;
307
- border: 1px solid #2a2a2a;
308
- border-radius: 6px;
309
- overflow: hidden;
310
- background: #1a1a1a;
311
- }
312
- .info-table tr {
313
- border-bottom: 1px solid #2a2a2a;
314
- }
315
- .info-table tr:last-child {
316
- border-bottom: none;
317
- }
318
- .info-table td {
319
- padding: 12px 16px;
320
- font-size: 13px;
321
- }
322
- .info-table td:first-child {
323
- background: #0f0f0f;
324
- font-weight: 500;
325
- color: #9ca3af;
326
- width: 180px;
327
- font-family: 'Monaco', 'Consolas', monospace;
328
- }
329
- .info-table td:last-child {
330
- color: #e5e7eb;
331
- word-break: break-all;
332
- font-family: 'Monaco', 'Consolas', monospace;
333
- }
334
- pre {
335
- background: #0a0a0a;
336
- padding: 16px;
337
- border-radius: 6px;
338
- overflow-x: auto;
339
- font-size: 13px;
340
- line-height: 1.6;
341
- color: #e5e7eb;
342
- font-family: 'Monaco', 'Consolas', monospace;
343
- border: 1px solid #2a2a2a;
344
- }
345
- .empty-state {
346
- display: flex;
347
- flex-direction: column;
348
- align-items: center;
349
- justify-content: center;
350
- height: 100%;
351
- color: #6b7280;
352
- padding: 60px 20px;
353
- }
354
- .empty-state svg {
355
- width: 64px;
356
- height: 64px;
357
- margin-bottom: 16px;
358
- opacity: 0.3;
359
- stroke: #6b7280;
360
- }
361
- .empty-detail {
362
- display: flex;
363
- flex-direction: column;
364
- align-items: center;
365
- justify-content: center;
366
- height: 100%;
367
- color: #6b7280;
368
- }
369
- .empty-detail svg {
370
- width: 64px;
371
- height: 64px;
372
- margin-bottom: 16px;
373
- opacity: 0.3;
374
- stroke: #6b7280;
375
- }
376
- ::-webkit-scrollbar {
377
- width: 8px;
378
- height: 8px;
379
- }
380
- ::-webkit-scrollbar-track {
381
- background: #0a0a0a;
382
- }
383
- ::-webkit-scrollbar-thumb {
384
- background: #2a2a2a;
385
- border-radius: 4px;
386
- }
387
- ::-webkit-scrollbar-thumb:hover {
388
- background: #3a3a3a;
389
- }
390
-
391
- /* JSON 渲染器样式 */
392
- .json-viewer {
393
- font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
394
- font-size: 13px;
395
- line-height: 1.6;
396
- background: #0a0a0a;
397
- padding: 16px;
398
- border-radius: 6px;
399
- border: 1px solid #2a2a2a;
400
- overflow-x: auto;
401
- }
402
-
403
- .json-line {
404
- margin: 2px 0;
405
- }
406
-
407
- .json-key {
408
- color: #8b5cf6;
409
- font-weight: 500;
410
- }
411
-
412
- .json-string {
413
- color: #10b981;
414
- }
415
-
416
- .json-number {
417
- color: #f59e0b;
418
- }
419
-
420
- .json-boolean {
421
- color: #3b82f6;
422
- font-weight: 600;
423
- }
424
-
425
- .json-null {
426
- color: #6b7280;
427
- font-style: italic;
428
- }
429
-
430
- .json-undefined {
431
- color: #6b7280;
432
- font-style: italic;
433
- }
434
-
435
- .json-bracket {
436
- color: #9ca3af;
437
- font-weight: bold;
438
- }
439
-
440
- .json-colon {
441
- color: #6b7280;
442
- }
443
-
444
- .json-comma {
445
- color: #6b7280;
446
- }
447
-
448
- .json-toggle {
449
- display: inline-block;
450
- width: 16px;
451
- text-align: center;
452
- transition: transform 0.2s;
453
- }
454
-
455
- .json-toggle:hover {
456
- color: #fff !important;
457
- }
458
-
459
- .json-comment {
460
- font-size: 11px;
461
- }
462
-
463
- /* @alenaksu/json-viewer 黑色主题 */
464
- json-viewer {
465
- --outline-style: none;
466
- --background-color: #000000;
467
- --color: #e5e7eb;
468
- --string-color: #a5d6ff;
469
- --number-color: #79c0ff;
470
- --boolean-color: #ff7b72;
471
- --null-color: #8b949e;
472
- --property-color: #d2a8ff;
473
- --preview-color: #8b949e;
474
- --font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
475
- --font-size: 13px;
476
- --line-height: 1.5rem;
477
- --indent-size: 0.75rem;
478
- }
479
-
480
- /* Body 标题栏 */
481
- .body-title-bar {
482
- display: flex;
483
- align-items: center;
484
- justify-content: space-between;
485
- }
486
- .body-actions {
487
- display: flex;
488
- align-items: center;
489
- gap: 6px;
490
- }
491
- .body-action-btn {
492
- display: inline-flex;
493
- align-items: center;
494
- gap: 4px;
495
- padding: 3px 8px;
496
- background: #1a1a1a;
497
- border: 1px solid #333;
498
- border-radius: 4px;
499
- color: #9ca3af;
500
- font-size: 12px;
501
- cursor: pointer;
502
- transition: all 0.15s;
503
- line-height: 1;
504
- }
505
- .body-action-btn:hover {
506
- background: #252525;
507
- color: #e5e7eb;
508
- border-color: #444;
509
- }
510
- .body-action-btn.active {
511
- background: #252525;
512
- color: #60a5fa;
513
- border-color: #3b82f6;
514
- }
515
- .body-action-btn svg {
516
- flex-shrink: 0;
517
- }
518
-
519
- /* 纯文本预览 */
520
- .body-text-view {
521
- background: #000;
522
- color: #e5e7eb;
523
- padding: 12px;
524
- border-radius: 6px;
525
- font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
526
- font-size: 13px;
527
- line-height: 1.5;
528
- overflow: auto;
529
- max-height: 600px;
530
- white-space: pre-wrap;
531
- word-break: break-all;
532
- margin: 0;
533
- }
534
-
535
- /* Toast 提示 */
536
- #copy-toast {
537
- position: fixed;
538
- bottom: 40px;
539
- left: 50%;
540
- transform: translateX(-50%) translateY(20px);
541
- background: #333;
542
- color: #fff;
543
- padding: 8px 20px;
544
- border-radius: 6px;
545
- font-size: 13px;
546
- opacity: 0;
547
- pointer-events: none;
548
- transition: all 0.25s ease;
549
- z-index: 9999;
550
- }
551
- #copy-toast.show {
552
- opacity: 1;
553
- transform: translateX(-50%) translateY(0);
554
- }
555
-
556
- /* ========== 对话模式 ========== */
557
- .chat-container {
558
- flex: 1;
559
- overflow-y: auto;
560
- padding: 24px 0;
561
- background: #0a0a0a;
562
- }
563
- .chat-messages {
564
- max-width: 900px;
565
- margin: 0 auto;
566
- padding: 0 24px;
567
- display: flex;
568
- flex-direction: column;
569
- gap: 16px;
570
- }
571
- .chat-message {
572
- display: flex;
573
- gap: 12px;
574
- max-width: 85%;
575
- }
576
- .chat-message.user {
577
- align-self: flex-end;
578
- flex-direction: row-reverse;
579
- }
580
- .chat-message.assistant,
581
- .chat-message.sub-agent {
582
- align-self: flex-start;
583
- }
584
- .chat-avatar {
585
- width: 36px;
586
- height: 36px;
587
- border-radius: 50%;
588
- flex-shrink: 0;
589
- display: flex;
590
- align-items: center;
591
- justify-content: center;
592
- }
593
- .chat-avatar.user-avatar {
594
- background: #3b82f6;
595
- }
596
- .chat-avatar.agent-avatar {
597
- background: #f59e0b;
598
- }
599
- .chat-avatar.sub-avatar {
600
- background: #6b7280;
601
- }
602
- .chat-avatar svg {
603
- width: 20px;
604
- height: 20px;
605
- fill: #fff;
606
- }
607
- .chat-bubble {
608
- border-radius: 12px;
609
- padding: 12px 16px;
610
- font-size: 14px;
611
- line-height: 1.6;
612
- word-break: break-word;
613
- min-width: 60px;
614
- }
615
- .chat-message.user .chat-bubble {
616
- background: #1d4ed8;
617
- color: #e5e7eb;
618
- border-top-right-radius: 4px;
619
- white-space: pre-wrap;
620
- }
621
- .chat-message.assistant .chat-bubble {
622
- background: #1f1f1f;
623
- color: #e5e7eb;
624
- border: 1px solid #2a2a2a;
625
- border-top-left-radius: 4px;
626
- }
627
- .chat-message.sub-agent .chat-bubble {
628
- background: #1a1a1a;
629
- color: #d1d5db;
630
- border: 1px solid #374151;
631
- border-left: 3px solid #6b7280;
632
- border-top-left-radius: 4px;
633
- }
634
- .chat-role-label {
635
- font-size: 11px;
636
- font-weight: 600;
637
- text-transform: uppercase;
638
- letter-spacing: 0.5px;
639
- margin-bottom: 4px;
640
- color: #9ca3af;
641
- }
642
- .chat-message.user .chat-role-label {
643
- text-align: right;
644
- color: #93c5fd;
645
- }
646
- .chat-message.assistant .chat-role-label {
647
- color: #fbbf24;
648
- }
649
- .chat-message.sub-agent .chat-role-label {
650
- color: #9ca3af;
651
- }
652
-
653
- /* 可折叠思考块 */
654
- .chat-thinking {
655
- margin-top: 8px;
656
- }
657
- .chat-thinking summary {
658
- cursor: pointer;
659
- font-size: 12px;
660
- color: #9ca3af;
661
- padding: 4px 0;
662
- user-select: none;
663
- }
664
- .chat-thinking summary:hover {
665
- color: #e5e7eb;
666
- }
667
- .chat-thinking-content {
668
- margin-top: 8px;
669
- padding: 10px 12px;
670
- background: #111;
671
- border-radius: 6px;
672
- font-size: 13px;
673
- color: #9ca3af;
674
- line-height: 1.5;
675
- white-space: pre-wrap;
676
- max-height: 400px;
677
- overflow-y: auto;
678
- }
679
-
680
- /* 工具调用卡片 */
681
- .chat-tool-call {
682
- margin-top: 8px;
683
- padding: 10px 12px;
684
- background: #111;
685
- border: 1px solid #2a2a2a;
686
- border-radius: 6px;
687
- font-size: 13px;
688
- }
689
- .chat-tool-call .tool-name {
690
- color: #a78bfa;
691
- font-weight: 600;
692
- font-family: 'SF Mono', Monaco, Consolas, monospace;
693
- }
694
- .chat-tool-call .tool-input {
695
- margin-top: 6px;
696
- color: #9ca3af;
697
- font-size: 12px;
698
- white-space: pre-wrap;
699
- max-height: 200px;
700
- overflow-y: auto;
701
- }
702
-
703
- /* 工具结果 */
704
- .chat-tool-result {
705
- margin-top: 8px;
706
- padding: 10px 12px;
707
- background: #0d1117;
708
- border: 1px solid #21262d;
709
- border-radius: 6px;
710
- font-size: 13px;
711
- max-height: 300px;
712
- overflow-y: auto;
713
- }
714
- .chat-tool-result .tool-result-label {
715
- font-size: 11px;
716
- font-weight: 600;
717
- color: #7ee787;
718
- margin-bottom: 6px;
719
- }
720
- .chat-tool-result .tool-result-content {
721
- color: #9ca3af;
722
- font-size: 12px;
723
- white-space: pre-wrap;
724
- word-break: break-all;
725
- }
726
-
727
- /* 对话模式空状态 */
728
- .chat-empty {
729
- display: flex;
730
- flex-direction: column;
731
- align-items: center;
732
- justify-content: center;
733
- height: 100%;
734
- color: #6b7280;
735
- gap: 12px;
736
- }
737
- .chat-empty svg {
738
- width: 48px;
739
- height: 48px;
740
- opacity: 0.3;
741
- }
742
-
743
- /* Markdown 内容样式 */
744
- .chat-md {
745
- line-height: 1.6;
746
- }
747
- .chat-md p {
748
- margin: 0 0 8px 0;
749
- }
750
- .chat-md p:last-child {
751
- margin-bottom: 0;
752
- }
753
- .chat-md code {
754
- background: #1e293b;
755
- color: #e2e8f0;
756
- padding: 2px 6px;
757
- border-radius: 4px;
758
- font-family: 'SF Mono', Monaco, 'Cascadia Code', Consolas, monospace;
759
- font-size: 0.88em;
760
- border: 1px solid #334155;
761
- }
762
- .chat-md pre {
763
- background: #0d1117;
764
- border: 1px solid #1e293b;
765
- border-radius: 8px;
766
- padding: 14px 16px;
767
- overflow-x: auto;
768
- margin: 10px 0;
769
- }
770
- .chat-md pre code {
771
- background: none;
772
- border: none;
773
- padding: 0;
774
- font-size: 13px;
775
- line-height: 1.6;
776
- color: #c9d1d9;
777
- }
778
- .chat-md ul, .chat-md ol {
779
- margin: 4px 0;
780
- padding-left: 20px;
781
- }
782
- .chat-md li {
783
- margin: 2px 0;
784
- }
785
- .chat-md h1, .chat-md h2, .chat-md h3, .chat-md h4 {
786
- margin: 12px 0 6px 0;
787
- color: #fff;
788
- }
789
- .chat-md h1 { font-size: 1.3em; }
790
- .chat-md h2 { font-size: 1.15em; }
791
- .chat-md h3 { font-size: 1.05em; }
792
- .chat-md blockquote {
793
- border-left: 3px solid #3b82f6;
794
- margin: 8px 0;
795
- padding: 4px 12px;
796
- color: #9ca3af;
797
- }
798
- .chat-md table {
799
- border-collapse: collapse;
800
- margin: 8px 0;
801
- font-size: 13px;
802
- }
803
- .chat-md th, .chat-md td {
804
- border: 1px solid #2a2a2a;
805
- padding: 6px 10px;
806
- }
807
- .chat-md th {
808
- background: #1a1a1a;
809
- color: #fff;
810
- }
811
- .chat-md a {
812
- color: #60a5fa;
813
- }
814
- .chat-md hr {
815
- border: none;
816
- border-top: 1px solid #2a2a2a;
817
- margin: 12px 0;
818
- }
819
- .chat-md strong {
820
- color: #f1f5f9;
821
- }
822
- .chat-md em {
823
- color: #cbd5e1;
824
- }