klaude-code 2.8.0__py3-none-any.whl → 2.8.1__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.
- klaude_code/cli/main.py +1 -1
- klaude_code/const.py +1 -1
- klaude_code/core/agent_profile.py +1 -1
- klaude_code/core/compaction/compaction.py +4 -6
- klaude_code/core/executor.py +18 -0
- klaude_code/core/tool/file/edit_tool.py +1 -2
- klaude_code/protocol/commands.py +1 -0
- klaude_code/protocol/op.py +14 -0
- klaude_code/protocol/op_handler.py +5 -0
- klaude_code/session/export.py +308 -299
- klaude_code/session/templates/export_session.html +430 -134
- klaude_code/tui/command/__init__.py +3 -0
- klaude_code/tui/command/continue_cmd.py +34 -0
- klaude_code/tui/components/rich/markdown.py +63 -12
- klaude_code/tui/renderer.py +1 -0
- {klaude_code-2.8.0.dist-info → klaude_code-2.8.1.dist-info}/METADATA +1 -1
- {klaude_code-2.8.0.dist-info → klaude_code-2.8.1.dist-info}/RECORD +19 -18
- {klaude_code-2.8.0.dist-info → klaude_code-2.8.1.dist-info}/WHEEL +0 -0
- {klaude_code-2.8.0.dist-info → klaude_code-2.8.1.dist-info}/entry_points.txt +0 -0
|
@@ -202,86 +202,6 @@
|
|
|
202
202
|
display: block;
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
-
/* Task: one user message + full agent run */
|
|
206
|
-
.task {
|
|
207
|
-
margin-bottom: 24px;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
.task:last-child {
|
|
211
|
-
margin-bottom: 0;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
/* Task steps: fold intermediate events by default */
|
|
215
|
-
details.task-steps {
|
|
216
|
-
margin: 6px 0 0 0;
|
|
217
|
-
background: transparent;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
details.task-steps > summary {
|
|
221
|
-
list-style: none;
|
|
222
|
-
user-select: none;
|
|
223
|
-
cursor: pointer;
|
|
224
|
-
display: inline-flex;
|
|
225
|
-
align-items: center;
|
|
226
|
-
gap: 8px;
|
|
227
|
-
padding: 4px 10px;
|
|
228
|
-
border-radius: 999px;
|
|
229
|
-
border: 1px solid var(--border);
|
|
230
|
-
background: var(--bg-card);
|
|
231
|
-
color: var(--text-dim);
|
|
232
|
-
font-family: var(--font-mono);
|
|
233
|
-
font-size: var(--font-size-xs);
|
|
234
|
-
line-height: 1.2;
|
|
235
|
-
transition: color 0.2s, border-color 0.2s, background 0.2s;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
details.task-steps > summary::-webkit-details-marker {
|
|
239
|
-
display: none;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
details.task-steps > summary::before {
|
|
243
|
-
content: "▶";
|
|
244
|
-
font-size: 0.8em;
|
|
245
|
-
color: var(--accent);
|
|
246
|
-
transform: translateY(-0.05em);
|
|
247
|
-
transition: transform 0.2s;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
details.task-steps[open] > summary {
|
|
251
|
-
color: var(--accent);
|
|
252
|
-
border-color: var(--accent);
|
|
253
|
-
background: var(--accent-dim);
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
details.task-steps[open] > summary::before {
|
|
257
|
-
transform: rotate(90deg) translateY(-0.05em);
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
details.task-steps > summary:hover {
|
|
261
|
-
color: var(--text);
|
|
262
|
-
border-color: var(--accent);
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
details.task-steps > .task-steps-content {
|
|
266
|
-
margin-top: 12px;
|
|
267
|
-
padding: 0 0 0 18px;
|
|
268
|
-
margin-left: 10px;
|
|
269
|
-
border-left: 2px solid var(--border);
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
/* When expanded, hide compact final answer to avoid duplication */
|
|
273
|
-
.task details.task-steps[open] ~ .task-final {
|
|
274
|
-
display: none;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
.task-final {
|
|
278
|
-
margin-top: 12px;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
.task-mermaid-result {
|
|
282
|
-
margin: 12px 0;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
205
|
.message-group {
|
|
286
206
|
display: flex;
|
|
287
207
|
flex-direction: column;
|
|
@@ -614,12 +534,14 @@
|
|
|
614
534
|
border-radius: var(--radius-md);
|
|
615
535
|
overflow: hidden;
|
|
616
536
|
font-size: var(--font-size-base);
|
|
537
|
+
/* Ensure background color to avoid gaps being transparent */
|
|
538
|
+
background: var(--bg-card); /* Using bg-card to unify */
|
|
617
539
|
}
|
|
618
540
|
|
|
619
541
|
.tool-header {
|
|
620
542
|
padding: 8px 12px;
|
|
621
543
|
background: var(--bg-container);
|
|
622
|
-
border-bottom
|
|
544
|
+
/* border-bottom removed to unify look */
|
|
623
545
|
display: flex;
|
|
624
546
|
justify-content: space-between;
|
|
625
547
|
align-items: center;
|
|
@@ -666,11 +588,14 @@
|
|
|
666
588
|
|
|
667
589
|
/* Collapsible tool-args */
|
|
668
590
|
details.tool-args-collapsible {
|
|
669
|
-
padding: 0;
|
|
670
591
|
background: var(--bg-body);
|
|
592
|
+
margin: 6px 12px;
|
|
593
|
+
border: 1px solid var(--border);
|
|
594
|
+
border-radius: var(--radius-sm);
|
|
595
|
+
overflow: hidden;
|
|
671
596
|
}
|
|
672
597
|
details.tool-args-collapsible > summary {
|
|
673
|
-
padding:
|
|
598
|
+
padding: 6px 10px;
|
|
674
599
|
font-family: var(--font-mono);
|
|
675
600
|
font-size: var(--font-size-xs);
|
|
676
601
|
text-transform: uppercase;
|
|
@@ -683,11 +608,17 @@
|
|
|
683
608
|
gap: 8px;
|
|
684
609
|
color: var(--text-dim);
|
|
685
610
|
transition: color 0.2s;
|
|
611
|
+
border-radius: var(--radius-sm);
|
|
686
612
|
}
|
|
687
613
|
details.tool-args-collapsible > summary:hover,
|
|
688
614
|
details.tool-args-collapsible[open] > summary {
|
|
689
615
|
color: var(--text);
|
|
690
616
|
}
|
|
617
|
+
details.tool-args-collapsible[open] > summary {
|
|
618
|
+
border-bottom: 1px solid var(--border);
|
|
619
|
+
border-bottom-left-radius: 0;
|
|
620
|
+
border-bottom-right-radius: 0;
|
|
621
|
+
}
|
|
691
622
|
details.tool-args-collapsible > summary::-webkit-details-marker {
|
|
692
623
|
display: none;
|
|
693
624
|
}
|
|
@@ -702,17 +633,17 @@
|
|
|
702
633
|
content: "[-]";
|
|
703
634
|
}
|
|
704
635
|
details.tool-args-collapsible > .tool-args-content {
|
|
705
|
-
padding:
|
|
636
|
+
padding: 10px;
|
|
706
637
|
font-family: var(--font-mono);
|
|
707
638
|
color: var(--text-dim);
|
|
708
639
|
overflow-x: auto;
|
|
709
640
|
white-space: pre-wrap;
|
|
710
641
|
font-size: var(--font-size-sm);
|
|
711
|
-
border-top
|
|
642
|
+
/* border-top handled by summary bottom border when open */
|
|
712
643
|
}
|
|
713
644
|
|
|
714
645
|
.tool-result {
|
|
715
|
-
border-top
|
|
646
|
+
/* border-top removed to unify look */
|
|
716
647
|
padding: 12px;
|
|
717
648
|
font-size: var(--font-size-sm);
|
|
718
649
|
}
|
|
@@ -726,14 +657,46 @@
|
|
|
726
657
|
.tool-result.success {
|
|
727
658
|
background: var(--bg-card);
|
|
728
659
|
color: var(--text);
|
|
660
|
+
--mask-bg: var(--bg-card);
|
|
729
661
|
}
|
|
730
662
|
.tool-result.error {
|
|
731
663
|
background: var(--bg-error);
|
|
732
664
|
color: var(--error);
|
|
665
|
+
--mask-bg: var(--bg-error);
|
|
733
666
|
}
|
|
734
667
|
.tool-result.pending {
|
|
735
668
|
background: var(--bg-body);
|
|
736
669
|
color: var(--text-dim);
|
|
670
|
+
--mask-bg: var(--bg-body);
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
/* Tool Output Collapsing */
|
|
674
|
+
.expandable-tool-output {
|
|
675
|
+
position: relative;
|
|
676
|
+
display: block;
|
|
677
|
+
}
|
|
678
|
+
.tool-output-preview {
|
|
679
|
+
position: relative;
|
|
680
|
+
max-height: 200px;
|
|
681
|
+
overflow: hidden;
|
|
682
|
+
transition: max-height 0.3s ease-out;
|
|
683
|
+
}
|
|
684
|
+
.tool-output-preview.expanded {
|
|
685
|
+
max-height: none;
|
|
686
|
+
overflow: visible;
|
|
687
|
+
}
|
|
688
|
+
.tool-output-preview:not(.expanded)::after {
|
|
689
|
+
content: "";
|
|
690
|
+
position: absolute;
|
|
691
|
+
bottom: 0;
|
|
692
|
+
left: 0;
|
|
693
|
+
right: 0;
|
|
694
|
+
height: 60px;
|
|
695
|
+
background: linear-gradient(to bottom, transparent 0%, var(--mask-bg, var(--bg-card)) 100%);
|
|
696
|
+
pointer-events: none;
|
|
697
|
+
}
|
|
698
|
+
.tool-output-preview.expanded + .expand-control {
|
|
699
|
+
display: none;
|
|
737
700
|
}
|
|
738
701
|
|
|
739
702
|
/* Sub-Agent Result */
|
|
@@ -744,6 +707,69 @@
|
|
|
744
707
|
margin-top: 8px;
|
|
745
708
|
}
|
|
746
709
|
|
|
710
|
+
/* Mermaid Special Layout */
|
|
711
|
+
.mermaid-container {
|
|
712
|
+
background: white;
|
|
713
|
+
padding: 16px;
|
|
714
|
+
border-radius: 4px;
|
|
715
|
+
border: 1px solid var(--border);
|
|
716
|
+
/* No top margin needed inside wrapper */
|
|
717
|
+
}
|
|
718
|
+
.mermaid-tool-call {
|
|
719
|
+
position: relative;
|
|
720
|
+
background: var(--bg-card);
|
|
721
|
+
border: 1px solid var(--border);
|
|
722
|
+
border-radius: var(--radius-md);
|
|
723
|
+
overflow: hidden;
|
|
724
|
+
display: flex;
|
|
725
|
+
flex-direction: column;
|
|
726
|
+
}
|
|
727
|
+
.mermaid-tool-call .mermaid-view {
|
|
728
|
+
position: relative;
|
|
729
|
+
order: 1;
|
|
730
|
+
}
|
|
731
|
+
.mermaid-tool-call .mermaid-container {
|
|
732
|
+
/* Override border/margin for cleaner look inside the wrapper */
|
|
733
|
+
border: none;
|
|
734
|
+
border-radius: 0;
|
|
735
|
+
margin: 0;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
.mermaid-info-btn {
|
|
739
|
+
position: absolute;
|
|
740
|
+
top: 12px;
|
|
741
|
+
right: 12px;
|
|
742
|
+
width: 24px;
|
|
743
|
+
height: 24px;
|
|
744
|
+
border-radius: 50%;
|
|
745
|
+
background: var(--bg-card);
|
|
746
|
+
border: 1px solid var(--border);
|
|
747
|
+
color: var(--text-dim);
|
|
748
|
+
font-family: var(--font-mono);
|
|
749
|
+
font-weight: bold;
|
|
750
|
+
font-size: 14px;
|
|
751
|
+
display: flex;
|
|
752
|
+
align-items: center;
|
|
753
|
+
justify-content: center;
|
|
754
|
+
cursor: pointer;
|
|
755
|
+
opacity: 0.6;
|
|
756
|
+
transition: all 0.2s;
|
|
757
|
+
z-index: 5;
|
|
758
|
+
}
|
|
759
|
+
.mermaid-info-btn:hover {
|
|
760
|
+
opacity: 1;
|
|
761
|
+
color: var(--accent);
|
|
762
|
+
border-color: var(--accent);
|
|
763
|
+
transform: scale(1.1);
|
|
764
|
+
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
.mermaid-meta {
|
|
768
|
+
border-bottom: 1px solid var(--border);
|
|
769
|
+
background: var(--bg-container);
|
|
770
|
+
order: -1;
|
|
771
|
+
}
|
|
772
|
+
|
|
747
773
|
.sub-agent-toolbar {
|
|
748
774
|
display: flex;
|
|
749
775
|
justify-content: flex-end;
|
|
@@ -1411,6 +1437,176 @@
|
|
|
1411
1437
|
font-weight: bold;
|
|
1412
1438
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
|
|
1413
1439
|
}
|
|
1440
|
+
|
|
1441
|
+
/* Header Controls */
|
|
1442
|
+
.header-controls {
|
|
1443
|
+
margin-top: 16px;
|
|
1444
|
+
display: flex;
|
|
1445
|
+
justify-content: flex-end;
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1448
|
+
.verbose-btn {
|
|
1449
|
+
display: inline-flex;
|
|
1450
|
+
align-items: center;
|
|
1451
|
+
gap: 8px;
|
|
1452
|
+
padding: 4px 12px;
|
|
1453
|
+
border: 1px solid var(--border);
|
|
1454
|
+
border-radius: 999px;
|
|
1455
|
+
cursor: pointer;
|
|
1456
|
+
font-family: var(--font-mono);
|
|
1457
|
+
font-size: var(--font-size-xs);
|
|
1458
|
+
color: var(--text-dim);
|
|
1459
|
+
background: transparent;
|
|
1460
|
+
transition: all 0.2s ease;
|
|
1461
|
+
user-select: none;
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
.verbose-btn:hover {
|
|
1465
|
+
color: var(--text);
|
|
1466
|
+
border-color: var(--accent);
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
.verbose-btn.active {
|
|
1470
|
+
background: var(--accent-dim);
|
|
1471
|
+
color: var(--accent);
|
|
1472
|
+
border-color: var(--accent);
|
|
1473
|
+
}
|
|
1474
|
+
|
|
1475
|
+
.verbose-btn input {
|
|
1476
|
+
display: none;
|
|
1477
|
+
}
|
|
1478
|
+
|
|
1479
|
+
.verbose-icon {
|
|
1480
|
+
font-family: var(--font-mono);
|
|
1481
|
+
font-weight: bold;
|
|
1482
|
+
/* Revert display/box properties from checkmark style */
|
|
1483
|
+
display: inline;
|
|
1484
|
+
width: auto;
|
|
1485
|
+
height: auto;
|
|
1486
|
+
border: none;
|
|
1487
|
+
border-radius: 0;
|
|
1488
|
+
position: static;
|
|
1489
|
+
transition: none;
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
/* Remove checkmark styles */
|
|
1493
|
+
.verbose-btn.active .verbose-icon {
|
|
1494
|
+
background: transparent;
|
|
1495
|
+
border-color: transparent;
|
|
1496
|
+
}
|
|
1497
|
+
.verbose-btn.active .verbose-icon::after {
|
|
1498
|
+
content: none;
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
/* Verbose Mode Visibility Logic */
|
|
1502
|
+
body:not(.verbose-mode) .thinking-block,
|
|
1503
|
+
body:not(.verbose-mode) details.developer-message,
|
|
1504
|
+
body:not(.verbose-mode) .response-metadata {
|
|
1505
|
+
display: none !important;
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
.turn-collapsible {
|
|
1509
|
+
margin: 16px 0;
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
.turn-collapse-btn {
|
|
1513
|
+
border: 1px solid var(--border);
|
|
1514
|
+
border-radius: 999px;
|
|
1515
|
+
background: transparent;
|
|
1516
|
+
color: var(--text-dim);
|
|
1517
|
+
font-family: var(--font-mono);
|
|
1518
|
+
font-size: var(--font-size-xs);
|
|
1519
|
+
padding: 4px 12px;
|
|
1520
|
+
cursor: pointer;
|
|
1521
|
+
display: inline-flex;
|
|
1522
|
+
align-items: center;
|
|
1523
|
+
gap: 6px;
|
|
1524
|
+
transition: all 0.2s;
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
.turn-collapse-btn:hover {
|
|
1528
|
+
color: var(--text);
|
|
1529
|
+
border-color: var(--accent);
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
.turn-collapse-btn.expanded {
|
|
1533
|
+
color: var(--accent);
|
|
1534
|
+
border-color: var(--accent);
|
|
1535
|
+
background: var(--accent-dim);
|
|
1536
|
+
}
|
|
1537
|
+
|
|
1538
|
+
.turn-steps {
|
|
1539
|
+
margin-top: 8px;
|
|
1540
|
+
padding-left: 16px;
|
|
1541
|
+
border-left: 2px solid var(--border);
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
/* Collapsible Markdown (Sub-agent) */
|
|
1545
|
+
.expandable-markdown {
|
|
1546
|
+
position: relative;
|
|
1547
|
+
display: block;
|
|
1548
|
+
}
|
|
1549
|
+
.markdown-preview {
|
|
1550
|
+
position: relative;
|
|
1551
|
+
max-height: 300px;
|
|
1552
|
+
overflow: hidden;
|
|
1553
|
+
transition: max-height 0.3s ease-out;
|
|
1554
|
+
}
|
|
1555
|
+
.markdown-preview.expanded {
|
|
1556
|
+
max-height: none;
|
|
1557
|
+
overflow: visible;
|
|
1558
|
+
}
|
|
1559
|
+
/* Mask for preview state */
|
|
1560
|
+
.markdown-preview:not(.expanded)::after {
|
|
1561
|
+
content: "";
|
|
1562
|
+
position: absolute;
|
|
1563
|
+
bottom: 0;
|
|
1564
|
+
left: 0;
|
|
1565
|
+
right: 0;
|
|
1566
|
+
height: 60px;
|
|
1567
|
+
background: linear-gradient(to bottom, transparent 0%, var(--bg-card) 100%);
|
|
1568
|
+
pointer-events: none;
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1571
|
+
.expand-control {
|
|
1572
|
+
display: flex;
|
|
1573
|
+
justify-content: center;
|
|
1574
|
+
margin-top: -20px; /* Pull button up into mask area */
|
|
1575
|
+
position: relative;
|
|
1576
|
+
z-index: 10;
|
|
1577
|
+
padding-bottom: 8px;
|
|
1578
|
+
}
|
|
1579
|
+
.markdown-preview.expanded + .expand-control {
|
|
1580
|
+
display: none;
|
|
1581
|
+
}
|
|
1582
|
+
|
|
1583
|
+
.expand-btn {
|
|
1584
|
+
background: var(--bg-card);
|
|
1585
|
+
border: 1px solid var(--border);
|
|
1586
|
+
border-radius: 999px;
|
|
1587
|
+
padding: 4px 16px;
|
|
1588
|
+
font-size: var(--font-size-xs);
|
|
1589
|
+
color: var(--accent);
|
|
1590
|
+
cursor: pointer;
|
|
1591
|
+
font-family: var(--font-mono);
|
|
1592
|
+
box-shadow: 0 2px 4px rgba(0,0,0,0.05);
|
|
1593
|
+
transition: all 0.2s;
|
|
1594
|
+
}
|
|
1595
|
+
.expand-btn:hover {
|
|
1596
|
+
border-color: var(--accent);
|
|
1597
|
+
color: var(--text);
|
|
1598
|
+
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1601
|
+
/* Mask for Tool Output */
|
|
1602
|
+
.expandable-output {
|
|
1603
|
+
position: relative;
|
|
1604
|
+
}
|
|
1605
|
+
.expandable-output:not(.expanded) .preview-text {
|
|
1606
|
+
/* Add mask to the text container itself */
|
|
1607
|
+
-webkit-mask-image: linear-gradient(to bottom, black calc(100% - 24px), transparent 100%);
|
|
1608
|
+
mask-image: linear-gradient(to bottom, black calc(100% - 24px), transparent 100%);
|
|
1609
|
+
}
|
|
1414
1610
|
</style>
|
|
1415
1611
|
</head>
|
|
1416
1612
|
<body>
|
|
@@ -1432,6 +1628,13 @@
|
|
|
1432
1628
|
<span class="meta-value" title="$work_dir_full">$work_dir</span>
|
|
1433
1629
|
</div>
|
|
1434
1630
|
</div>
|
|
1631
|
+
<div class="header-controls">
|
|
1632
|
+
<label class="verbose-btn" id="verbose-label">
|
|
1633
|
+
<input type="checkbox" id="verbose-toggle" />
|
|
1634
|
+
<span class="verbose-icon">[+]</span>
|
|
1635
|
+
<span class="verbose-text">Verbose</span>
|
|
1636
|
+
</label>
|
|
1637
|
+
</div>
|
|
1435
1638
|
</div>
|
|
1436
1639
|
|
|
1437
1640
|
<details class="collapsible-section">
|
|
@@ -1516,21 +1719,6 @@
|
|
|
1516
1719
|
el.textContent = el.textContent.trim();
|
|
1517
1720
|
});
|
|
1518
1721
|
|
|
1519
|
-
// Task steps toggle label
|
|
1520
|
-
document.querySelectorAll("details.task-steps").forEach((details) => {
|
|
1521
|
-
const summary = details.querySelector("summary");
|
|
1522
|
-
const count = details.getAttribute("data-step-count");
|
|
1523
|
-
if (!summary || !count) return;
|
|
1524
|
-
|
|
1525
|
-
const setLabel = () => {
|
|
1526
|
-
summary.textContent =
|
|
1527
|
-
(details.open ? "Hide" : "Show") + " " + count + " steps";
|
|
1528
|
-
};
|
|
1529
|
-
|
|
1530
|
-
setLabel();
|
|
1531
|
-
details.addEventListener("toggle", setLabel);
|
|
1532
|
-
});
|
|
1533
|
-
|
|
1534
1722
|
// Process markdown for collapsible sections
|
|
1535
1723
|
// foldH2: if true, H2 headers start collapsed; otherwise all headers start open
|
|
1536
1724
|
function structureMarkdown(root, foldH2 = false) {
|
|
@@ -1917,44 +2105,70 @@
|
|
|
1917
2105
|
});
|
|
1918
2106
|
}
|
|
1919
2107
|
|
|
1920
|
-
// 2.
|
|
2108
|
+
// 2. Messages and Tools
|
|
1921
2109
|
const stream = document.querySelector(".message-stream");
|
|
1922
2110
|
if (stream) {
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
2111
|
+
// Use a Walker to find top-level relevant items if structure is complex
|
|
2112
|
+
// But assuming flat children of message-stream based on CSS
|
|
2113
|
+
Array.from(stream.children).forEach((child) => {
|
|
2114
|
+
let label = null;
|
|
2115
|
+
let idPrefix = "section";
|
|
2116
|
+
|
|
2117
|
+
if (child.classList.contains("message-group")) {
|
|
2118
|
+
const roleLabel = child.querySelector(".role-label");
|
|
2119
|
+
if (roleLabel) {
|
|
2120
|
+
if (roleLabel.classList.contains("user")) {
|
|
2121
|
+
userCount++;
|
|
2122
|
+
label = `USER $$$${userCount}`;
|
|
2123
|
+
idPrefix = "user";
|
|
2124
|
+
} else if (roleLabel.classList.contains("assistant")) {
|
|
2125
|
+
assistantCount++;
|
|
2126
|
+
label = `ASSISTANT $$$${assistantCount}`;
|
|
2127
|
+
idPrefix = "assistant";
|
|
2128
|
+
} else {
|
|
2129
|
+
label = roleLabel.textContent.trim();
|
|
2130
|
+
}
|
|
2131
|
+
}
|
|
2132
|
+
} else if (child.classList.contains("tool-call")) {
|
|
2133
|
+
const toolName = child.querySelector(".tool-name");
|
|
2134
|
+
if (toolName) {
|
|
2135
|
+
label = toolName.textContent.trim();
|
|
2136
|
+
idPrefix = "tool";
|
|
2137
|
+
|
|
2138
|
+
// Try to extract description for Sub Agents
|
|
2139
|
+
try {
|
|
2140
|
+
const argsContent = child.querySelector(".tool-args-content");
|
|
2141
|
+
if (argsContent) {
|
|
2142
|
+
const argsText = argsContent.textContent.trim();
|
|
2143
|
+
if (argsText.startsWith("{")) {
|
|
2144
|
+
const args = JSON.parse(argsText);
|
|
2145
|
+
if (
|
|
2146
|
+
args &&
|
|
2147
|
+
typeof args.description === "string" &&
|
|
2148
|
+
args.description.trim()
|
|
2149
|
+
) {
|
|
2150
|
+
let desc = args.description.trim();
|
|
2151
|
+
if (desc.length > 30) {
|
|
2152
|
+
desc = desc.substring(0, 30) + "…";
|
|
2153
|
+
}
|
|
2154
|
+
label = label + " - " + desc;
|
|
2155
|
+
}
|
|
2156
|
+
}
|
|
2157
|
+
}
|
|
2158
|
+
} catch (e) {
|
|
2159
|
+
// Ignore JSON parse errors
|
|
2160
|
+
}
|
|
2161
|
+
} else {
|
|
2162
|
+
label = "Tool";
|
|
1936
2163
|
}
|
|
1937
2164
|
}
|
|
1938
2165
|
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
(child
|
|
1944
|
-
|
|
1945
|
-
if (!roleLabel || !roleLabel.classList.contains("assistant")) return;
|
|
1946
|
-
|
|
1947
|
-
assistantCount++;
|
|
1948
|
-
child.id =
|
|
1949
|
-
child.id ||
|
|
1950
|
-
"assistant-" + Math.random().toString(36).substr(2, 9);
|
|
1951
|
-
sections.push({
|
|
1952
|
-
id: child.id,
|
|
1953
|
-
label: "ASSISTANT " + assistantCount,
|
|
1954
|
-
el: child,
|
|
1955
|
-
});
|
|
1956
|
-
}
|
|
1957
|
-
);
|
|
2166
|
+
if (label) {
|
|
2167
|
+
child.id =
|
|
2168
|
+
child.id ||
|
|
2169
|
+
`$$$${idPrefix}-$$$${Math.random().toString(36).substr(2, 9)}`;
|
|
2170
|
+
sections.push({ id: child.id, label: label, el: child });
|
|
2171
|
+
}
|
|
1958
2172
|
});
|
|
1959
2173
|
}
|
|
1960
2174
|
|
|
@@ -2023,6 +2237,88 @@
|
|
|
2023
2237
|
// Initial update
|
|
2024
2238
|
updateActiveSection();
|
|
2025
2239
|
});
|
|
2240
|
+
|
|
2241
|
+
// Mermaid info toggle
|
|
2242
|
+
document.querySelectorAll('.mermaid-info-btn').forEach(btn => {
|
|
2243
|
+
btn.addEventListener('click', (e) => {
|
|
2244
|
+
e.stopPropagation(); // prevent collapsing turn
|
|
2245
|
+
const container = btn.closest('.mermaid-tool-call');
|
|
2246
|
+
const meta = container.querySelector('.mermaid-meta');
|
|
2247
|
+
if (meta) {
|
|
2248
|
+
const isHidden = meta.style.display === 'none';
|
|
2249
|
+
meta.style.display = isHidden ? 'block' : 'none';
|
|
2250
|
+
btn.style.color = isHidden ? 'var(--accent)' : '';
|
|
2251
|
+
btn.style.borderColor = isHidden ? 'var(--accent)' : '';
|
|
2252
|
+
btn.style.opacity = isHidden ? '1' : '';
|
|
2253
|
+
}
|
|
2254
|
+
});
|
|
2255
|
+
});
|
|
2256
|
+
|
|
2257
|
+
// Turn collapsing
|
|
2258
|
+
document.querySelectorAll('.turn-collapse-btn').forEach(btn => {
|
|
2259
|
+
btn.addEventListener('click', () => {
|
|
2260
|
+
const container = btn.parentElement;
|
|
2261
|
+
const steps = container.querySelector('.turn-steps');
|
|
2262
|
+
const isHidden = steps.style.display === 'none';
|
|
2263
|
+
|
|
2264
|
+
steps.style.display = isHidden ? 'block' : 'none';
|
|
2265
|
+
btn.classList.toggle('expanded', isHidden);
|
|
2266
|
+
|
|
2267
|
+
const icon = btn.querySelector('.collapse-icon');
|
|
2268
|
+
if (icon) icon.textContent = isHidden ? '[-]' : '[+]';
|
|
2269
|
+
});
|
|
2270
|
+
});
|
|
2271
|
+
|
|
2272
|
+
// Expandable content (Sub-agent markdown & Tool output)
|
|
2273
|
+
document.body.addEventListener('click', (e) => {
|
|
2274
|
+
if (e.target.classList.contains('expand-btn')) {
|
|
2275
|
+
const container = e.target.closest('.expandable-markdown, .expandable-tool-output');
|
|
2276
|
+
if (container) {
|
|
2277
|
+
const preview = container.querySelector('.markdown-preview, .tool-output-preview');
|
|
2278
|
+
if (preview) {
|
|
2279
|
+
preview.classList.add('expanded');
|
|
2280
|
+
}
|
|
2281
|
+
}
|
|
2282
|
+
}
|
|
2283
|
+
});
|
|
2284
|
+
|
|
2285
|
+
// Verbose Toggle
|
|
2286
|
+
const verboseToggle = document.getElementById('verbose-toggle');
|
|
2287
|
+
const verboseLabel = document.getElementById('verbose-label');
|
|
2288
|
+
let isVerbose = false;
|
|
2289
|
+
|
|
2290
|
+
function updateVerboseUI() {
|
|
2291
|
+
const icon = verboseLabel ? verboseLabel.querySelector('.verbose-icon') : null;
|
|
2292
|
+
|
|
2293
|
+
if (isVerbose) {
|
|
2294
|
+
document.body.classList.add('verbose-mode');
|
|
2295
|
+
if (verboseLabel) verboseLabel.classList.add('active');
|
|
2296
|
+
if (icon) icon.textContent = '[-]';
|
|
2297
|
+
} else {
|
|
2298
|
+
document.body.classList.remove('verbose-mode');
|
|
2299
|
+
if (verboseLabel) verboseLabel.classList.remove('active');
|
|
2300
|
+
if (icon) icon.textContent = '[+]';
|
|
2301
|
+
// Enforce collapsing of details when switching to non-verbose
|
|
2302
|
+
document.querySelectorAll('details.tool-args-collapsible, details.diff-collapsible, details.sub-agent-session').forEach(el => {
|
|
2303
|
+
el.removeAttribute('open');
|
|
2304
|
+
});
|
|
2305
|
+
}
|
|
2306
|
+
}
|
|
2307
|
+
|
|
2308
|
+
if (verboseToggle) {
|
|
2309
|
+
verboseToggle.addEventListener('change', (e) => {
|
|
2310
|
+
isVerbose = e.target.checked;
|
|
2311
|
+
updateVerboseUI();
|
|
2312
|
+
});
|
|
2313
|
+
|
|
2314
|
+
// Initialize state (default false)
|
|
2315
|
+
// Also force close any initially open details if non-verbose
|
|
2316
|
+
if (!isVerbose) {
|
|
2317
|
+
document.querySelectorAll('details.tool-args-collapsible, details.diff-collapsible, details.sub-agent-session').forEach(el => {
|
|
2318
|
+
el.removeAttribute('open');
|
|
2319
|
+
});
|
|
2320
|
+
}
|
|
2321
|
+
}
|
|
2026
2322
|
</script>
|
|
2027
2323
|
</body>
|
|
2028
2324
|
</html>
|
|
@@ -31,6 +31,7 @@ def ensure_commands_loaded() -> None:
|
|
|
31
31
|
# Import and register commands in display order
|
|
32
32
|
from .clear_cmd import ClearCommand
|
|
33
33
|
from .compact_cmd import CompactCommand
|
|
34
|
+
from .continue_cmd import ContinueCommand
|
|
34
35
|
from .copy_cmd import CopyCommand
|
|
35
36
|
from .debug_cmd import DebugCommand
|
|
36
37
|
from .export_cmd import ExportCommand
|
|
@@ -47,6 +48,7 @@ def ensure_commands_loaded() -> None:
|
|
|
47
48
|
register(CopyCommand())
|
|
48
49
|
register(ExportCommand())
|
|
49
50
|
register(CompactCommand())
|
|
51
|
+
register(ContinueCommand())
|
|
50
52
|
register(RefreshTerminalCommand())
|
|
51
53
|
register(ModelCommand())
|
|
52
54
|
register(SubAgentModelCommand())
|
|
@@ -67,6 +69,7 @@ def __getattr__(name: str) -> object:
|
|
|
67
69
|
_commands_map = {
|
|
68
70
|
"ClearCommand": "clear_cmd",
|
|
69
71
|
"CompactCommand": "compact_cmd",
|
|
72
|
+
"ContinueCommand": "continue_cmd",
|
|
70
73
|
"CopyCommand": "copy_cmd",
|
|
71
74
|
"DebugCommand": "debug_cmd",
|
|
72
75
|
"ExportCommand": "export_cmd",
|