@firstpick/pi-package-webui 0.7.3 → 0.7.4
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/README.md +33 -20
- package/bin/pi-webui.mjs +203 -39
- package/index.ts +10 -1
- package/lib/git-workflow-preferences.mjs +10 -3
- package/lib/webui-output-mode.mjs +97 -0
- package/package.json +5 -5
- package/public/app.js +688 -24
- package/public/fast-output-live.mjs +179 -0
- package/public/index.html +28 -3
- package/public/service-worker.js +2 -1
- package/public/styles.css +391 -16
- package/tests/fast-mode-client-static.test.mjs +121 -0
- package/tests/fast-mode-output-work.test.mjs +69 -0
- package/tests/fast-mode-sse-harness.test.mjs +204 -0
- package/tests/fast-output-live.test.mjs +106 -0
- package/tests/fixtures/fake-pi.mjs +58 -0
- package/tests/fixtures/fast-mode-output-events.mjs +50 -0
- package/tests/git-workflow-preferences.test.mjs +8 -2
- package/tests/http-endpoints-harness.test.mjs +9 -0
- package/tests/mobile-static.test.mjs +58 -14
- package/tests/remote-auth-settings-harness.test.mjs +1 -1
- package/tests/webui-output-mode.test.mjs +73 -0
package/public/styles.css
CHANGED
|
@@ -2255,6 +2255,9 @@ body.embedded-split .side-panel-backdrop {
|
|
|
2255
2255
|
font-size: var(--text-xs);
|
|
2256
2256
|
font-weight: 700;
|
|
2257
2257
|
}
|
|
2258
|
+
.toggle-control-hint.warning {
|
|
2259
|
+
color: var(--ctp-yellow);
|
|
2260
|
+
}
|
|
2258
2261
|
.toggle-control:has(input:checked) {
|
|
2259
2262
|
border-color: rgba(148, 226, 213, 0.42);
|
|
2260
2263
|
box-shadow: 0 0 0.9rem rgba(148, 226, 213, 0.10);
|
|
@@ -3223,9 +3226,8 @@ body.embedded-split .side-panel-backdrop {
|
|
|
3223
3226
|
padding-top: 0.38rem;
|
|
3224
3227
|
min-width: 0;
|
|
3225
3228
|
max-width: 100%;
|
|
3226
|
-
max-height:
|
|
3227
|
-
overflow:
|
|
3228
|
-
scrollbar-width: thin;
|
|
3229
|
+
max-height: none;
|
|
3230
|
+
overflow: visible;
|
|
3229
3231
|
}
|
|
3230
3232
|
.terminal-tab-group:hover .terminal-tab-group-menu,
|
|
3231
3233
|
.terminal-tab-group:focus-within .terminal-tab-group-menu,
|
|
@@ -3786,8 +3788,7 @@ body.embedded-split .side-panel-backdrop {
|
|
|
3786
3788
|
background: linear-gradient(90deg, rgba(203, 166, 247, 0.10), rgba(137, 180, 250, 0.05), rgba(148, 226, 213, 0.08));
|
|
3787
3789
|
}
|
|
3788
3790
|
.widget-area:has(.release-npm-live-widget .release-npm-output-details[open]),
|
|
3789
|
-
.widget-area:has(.release-aur-live-widget .release-npm-output-details[open])
|
|
3790
|
-
.widget-area:has(.workflow-live-widget .release-npm-output-details[open]) {
|
|
3791
|
+
.widget-area:has(.release-aur-live-widget .release-npm-output-details[open]) {
|
|
3791
3792
|
flex: 0 0 min(44rem, 68dvh);
|
|
3792
3793
|
min-height: 0;
|
|
3793
3794
|
overflow: auto;
|
|
@@ -3795,6 +3796,14 @@ body.embedded-split .side-panel-backdrop {
|
|
|
3795
3796
|
scrollbar-gutter: stable;
|
|
3796
3797
|
overflow-anchor: none;
|
|
3797
3798
|
}
|
|
3799
|
+
.widget-area:has(.workflow-live-widget .release-npm-output-details[open]) {
|
|
3800
|
+
min-height: 0;
|
|
3801
|
+
overflow-x: hidden;
|
|
3802
|
+
overflow-y: auto;
|
|
3803
|
+
overscroll-behavior-y: contain;
|
|
3804
|
+
scrollbar-gutter: stable;
|
|
3805
|
+
overflow-anchor: none;
|
|
3806
|
+
}
|
|
3798
3807
|
.widget-area:has(.app-runner-live-widget .release-npm-output-details[open]) {
|
|
3799
3808
|
flex: 0 0 auto;
|
|
3800
3809
|
min-height: 0;
|
|
@@ -3803,12 +3812,15 @@ body.embedded-split .side-panel-backdrop {
|
|
|
3803
3812
|
scrollbar-gutter: auto;
|
|
3804
3813
|
overflow-anchor: none;
|
|
3805
3814
|
}
|
|
3806
|
-
.widget-area:has(.workflow-widget) {
|
|
3807
|
-
|
|
3808
|
-
max-height: min(
|
|
3815
|
+
.widget-area:has(.workflow-widget:not(.minimized)) {
|
|
3816
|
+
/* Follow rendered workflow content until the viewport-safe cap becomes the scroll boundary. */
|
|
3817
|
+
--workflow-overlay-max-height: min(44rem, 68dvh);
|
|
3818
|
+
flex: 0 0 auto;
|
|
3819
|
+
max-height: var(--workflow-overlay-max-height);
|
|
3809
3820
|
min-height: 0;
|
|
3810
|
-
overflow:
|
|
3811
|
-
|
|
3821
|
+
overflow-x: hidden;
|
|
3822
|
+
overflow-y: auto;
|
|
3823
|
+
overscroll-behavior-y: contain;
|
|
3812
3824
|
scrollbar-gutter: stable;
|
|
3813
3825
|
overflow-anchor: none;
|
|
3814
3826
|
}
|
|
@@ -5487,13 +5499,89 @@ button.git-workflow-step:hover:not(:disabled) {
|
|
|
5487
5499
|
linear-gradient(145deg, rgba(var(--ctp-crust-rgb), 0.98), rgba(var(--ctp-mantle-rgb), 0.92));
|
|
5488
5500
|
}
|
|
5489
5501
|
.workflow-widget .release-npm-kicker { color: var(--ctp-blue); }
|
|
5490
|
-
.workflow-
|
|
5491
|
-
|
|
5502
|
+
.workflow-subprocess-widget > .release-npm-header {
|
|
5503
|
+
grid-template-columns: minmax(12rem, 0.7fr) minmax(22rem, 1.7fr) auto;
|
|
5504
|
+
align-items: stretch;
|
|
5505
|
+
padding-bottom: 0.62rem;
|
|
5506
|
+
border-bottom: 1px solid rgba(137, 180, 250, 0.18);
|
|
5507
|
+
}
|
|
5508
|
+
.workflow-subprocess-widget .workflow-meta {
|
|
5509
|
+
display: grid;
|
|
5510
|
+
grid-template-columns: repeat(4, minmax(7rem, 1fr));
|
|
5511
|
+
gap: 0.38rem;
|
|
5512
|
+
align-items: stretch;
|
|
5513
|
+
justify-content: stretch;
|
|
5514
|
+
}
|
|
5515
|
+
.workflow-meta-item {
|
|
5516
|
+
display: grid;
|
|
5517
|
+
gap: 0.1rem;
|
|
5518
|
+
min-width: 0;
|
|
5519
|
+
padding: 0.36rem 0.48rem;
|
|
5520
|
+
border: 1px solid rgba(137, 180, 250, 0.22);
|
|
5521
|
+
border-radius: 0.56rem;
|
|
5522
|
+
background: rgba(var(--ctp-crust-rgb), 0.58);
|
|
5523
|
+
}
|
|
5524
|
+
.workflow-meta-label {
|
|
5525
|
+
color: rgba(var(--ctp-subtext-rgb), 0.72);
|
|
5526
|
+
font-size: var(--text-xs);
|
|
5527
|
+
font-weight: 900;
|
|
5528
|
+
letter-spacing: 0.1em;
|
|
5529
|
+
line-height: 1.1;
|
|
5530
|
+
text-transform: uppercase;
|
|
5531
|
+
}
|
|
5532
|
+
.workflow-meta-value {
|
|
5533
|
+
min-width: 0;
|
|
5534
|
+
overflow: hidden;
|
|
5535
|
+
color: var(--ctp-text);
|
|
5536
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
|
|
5537
|
+
font-size: var(--text-xs);
|
|
5538
|
+
line-height: 1.3;
|
|
5539
|
+
text-overflow: ellipsis;
|
|
5540
|
+
white-space: nowrap;
|
|
5541
|
+
}
|
|
5542
|
+
.workflow-meta-description {
|
|
5543
|
+
color: rgba(var(--ctp-subtext-rgb), 0.82);
|
|
5544
|
+
font-size: var(--text-xs);
|
|
5545
|
+
line-height: 1.3;
|
|
5546
|
+
overflow-wrap: anywhere;
|
|
5547
|
+
}
|
|
5548
|
+
.workflow-meta-item.workflow-status.completed .workflow-meta-value { color: var(--ctp-green); }
|
|
5549
|
+
.workflow-meta-item.workflow-status.failed .workflow-meta-value { color: var(--ctp-red); }
|
|
5550
|
+
.workflow-meta-item.workflow-status.cancelled .workflow-meta-value { color: var(--ctp-yellow); }
|
|
5551
|
+
.workflow-meta-item.workflow-status.running .workflow-meta-value,
|
|
5552
|
+
.workflow-meta-item.workflow-status.queued .workflow-meta-value { color: var(--ctp-blue); }
|
|
5553
|
+
.workflow-meta-item.workflow-tasks .workflow-meta-value { color: var(--ctp-teal); }
|
|
5554
|
+
.workflow-meta-item.workflow-truncated {
|
|
5555
|
+
border-color: rgba(250, 179, 135, 0.4);
|
|
5556
|
+
background: rgba(250, 179, 135, 0.08);
|
|
5557
|
+
}
|
|
5558
|
+
.workflow-meta-item.workflow-truncated .workflow-meta-value { color: var(--ctp-peach); }
|
|
5559
|
+
.workflow-output-controls {
|
|
5560
|
+
display: flex;
|
|
5561
|
+
align-items: center;
|
|
5562
|
+
justify-content: space-between;
|
|
5563
|
+
gap: 0.5rem 1rem;
|
|
5564
|
+
min-height: 1.35rem;
|
|
5565
|
+
padding-inline: 0.18rem;
|
|
5566
|
+
}
|
|
5567
|
+
.workflow-follow-status { color: var(--ctp-green); }
|
|
5568
|
+
.workflow-follow-status.paused { color: var(--ctp-yellow); }
|
|
5569
|
+
.workflow-output-help { margin-left: auto; text-align: right; }
|
|
5570
|
+
.workflow-inspector-widget.minimized,
|
|
5571
|
+
.workflow-subprocess-widget.minimized { gap: 0; }
|
|
5572
|
+
.workflow-subprocess-widget.minimized > .release-npm-header {
|
|
5573
|
+
padding-bottom: 0;
|
|
5574
|
+
border-bottom: 0;
|
|
5575
|
+
}
|
|
5576
|
+
.workflow-inspector-minimize-button,
|
|
5577
|
+
.workflow-subprocess-minimize-button {
|
|
5492
5578
|
border-color: rgba(137, 180, 250, 0.42);
|
|
5493
5579
|
color: var(--ctp-blue);
|
|
5494
5580
|
}
|
|
5495
5581
|
.workflow-inspector-minimize-button:hover,
|
|
5496
|
-
.workflow-inspector-minimize-button:focus-visible
|
|
5582
|
+
.workflow-inspector-minimize-button:focus-visible,
|
|
5583
|
+
.workflow-subprocess-minimize-button:hover,
|
|
5584
|
+
.workflow-subprocess-minimize-button:focus-visible { border-color: rgba(137, 180, 250, 0.82); }
|
|
5497
5585
|
.workflow-widget .release-npm-pill.workflow-status.completed { color: var(--ctp-green); }
|
|
5498
5586
|
.workflow-widget .release-npm-pill.workflow-status.failed { color: var(--ctp-red); }
|
|
5499
5587
|
.workflow-widget .release-npm-pill.workflow-status.cancelled { color: var(--ctp-yellow); }
|
|
@@ -5595,12 +5683,24 @@ button.git-workflow-step:hover:not(:disabled) {
|
|
|
5595
5683
|
}
|
|
5596
5684
|
.workflow-inspector-agent-summary { display: flex; gap: 0.55rem; align-items: center; }
|
|
5597
5685
|
.workflow-inspector-agent-body { display: grid; gap: 0.5rem; padding: 0 0.55rem 0.55rem; }
|
|
5686
|
+
@media (max-width: 1100px) {
|
|
5687
|
+
.workflow-subprocess-widget > .release-npm-header {
|
|
5688
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
5689
|
+
}
|
|
5690
|
+
.workflow-subprocess-widget > .release-npm-header .workflow-meta { grid-column: 1 / -1; grid-row: 2; }
|
|
5691
|
+
}
|
|
5598
5692
|
@media (max-width: 720px), (max-device-width: 720px), (pointer: coarse) and (hover: none) {
|
|
5693
|
+
.workflow-subprocess-widget > .release-npm-header { grid-template-columns: minmax(0, 1fr); }
|
|
5694
|
+
.workflow-subprocess-widget > .release-npm-header .workflow-meta { grid-column: auto; grid-row: auto; }
|
|
5695
|
+
.workflow-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
5696
|
+
.workflow-output-controls { align-items: flex-start; flex-direction: column; }
|
|
5697
|
+
.workflow-output-help { margin-left: 0; text-align: left; }
|
|
5599
5698
|
.workflow-inspector-layout { grid-template-columns: 1fr; }
|
|
5600
5699
|
.workflow-inspector-run-list { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 13rem; }
|
|
5601
5700
|
.workflow-inspector-actions { justify-content: stretch; }
|
|
5602
5701
|
.workflow-inspector-actions button { flex: 1 1 7rem; min-height: 44px; }
|
|
5603
|
-
.workflow-inspector-minimize-button
|
|
5702
|
+
.workflow-inspector-minimize-button,
|
|
5703
|
+
.workflow-subprocess-minimize-button { min-height: 44px; }
|
|
5604
5704
|
}
|
|
5605
5705
|
.btw-widget {
|
|
5606
5706
|
border-color: rgba(148, 226, 213, 0.62);
|
|
@@ -5938,6 +6038,7 @@ button.git-workflow-step:hover:not(:disabled) {
|
|
|
5938
6038
|
}
|
|
5939
6039
|
.release-npm-output-details {
|
|
5940
6040
|
display: grid;
|
|
6041
|
+
grid-template-columns: minmax(0, 1fr);
|
|
5941
6042
|
gap: 0.58rem;
|
|
5942
6043
|
min-width: 0;
|
|
5943
6044
|
}
|
|
@@ -6002,11 +6103,18 @@ button.git-workflow-step:hover:not(:disabled) {
|
|
|
6002
6103
|
overscroll-behavior: contain;
|
|
6003
6104
|
}
|
|
6004
6105
|
.release-npm-live-widget .release-npm-output-details[open] .release-npm-terminal,
|
|
6005
|
-
.release-aur-live-widget .release-npm-output-details[open] .release-npm-terminal
|
|
6006
|
-
.workflow-live-widget .release-npm-output-details[open] .release-npm-terminal {
|
|
6106
|
+
.release-aur-live-widget .release-npm-output-details[open] .release-npm-terminal {
|
|
6007
6107
|
height: clamp(15rem, 42dvh, 31rem);
|
|
6008
6108
|
min-height: 0;
|
|
6009
6109
|
}
|
|
6110
|
+
.workflow-subprocess-widget .release-npm-output-details[open] .release-npm-terminal {
|
|
6111
|
+
max-height: clamp(12rem, 34dvh, 26rem);
|
|
6112
|
+
min-height: 0;
|
|
6113
|
+
overflow-anchor: none;
|
|
6114
|
+
overscroll-behavior-x: contain;
|
|
6115
|
+
overscroll-behavior-y: auto;
|
|
6116
|
+
scrollbar-gutter: stable;
|
|
6117
|
+
}
|
|
6010
6118
|
.release-npm-line {
|
|
6011
6119
|
display: block;
|
|
6012
6120
|
width: max-content;
|
|
@@ -6942,6 +7050,23 @@ button.git-workflow-step:hover:not(:disabled) {
|
|
|
6942
7050
|
.streaming-markdown {
|
|
6943
7051
|
min-height: 1.35rem;
|
|
6944
7052
|
}
|
|
7053
|
+
.compact-live-output {
|
|
7054
|
+
outline-color: rgba(148, 226, 213, 0.46);
|
|
7055
|
+
}
|
|
7056
|
+
.compact-live-text,
|
|
7057
|
+
.compact-live-thinking,
|
|
7058
|
+
.compact-tool-status {
|
|
7059
|
+
min-height: 1.35rem;
|
|
7060
|
+
white-space: pre-wrap;
|
|
7061
|
+
overflow-wrap: anywhere;
|
|
7062
|
+
}
|
|
7063
|
+
.compact-live-thinking {
|
|
7064
|
+
color: rgba(var(--ctp-text-rgb), 0.82);
|
|
7065
|
+
font-style: italic;
|
|
7066
|
+
}
|
|
7067
|
+
.compact-tool-shell .compact-tool-status {
|
|
7068
|
+
color: var(--ctp-subtext);
|
|
7069
|
+
}
|
|
6945
7070
|
.text-block, .code-block {
|
|
6946
7071
|
margin: 0.35rem 0;
|
|
6947
7072
|
white-space: pre-wrap;
|
|
@@ -7092,6 +7217,37 @@ summary { cursor: pointer; color: var(--warning); }
|
|
|
7092
7217
|
.composer-skill-tags[hidden] {
|
|
7093
7218
|
display: none !important;
|
|
7094
7219
|
}
|
|
7220
|
+
.composer-feature-category-tag {
|
|
7221
|
+
flex: 0 1 auto;
|
|
7222
|
+
min-width: 0;
|
|
7223
|
+
max-width: min(14rem, 100%);
|
|
7224
|
+
padding: 0.14rem 0.56rem;
|
|
7225
|
+
border: 1px solid rgba(148, 226, 213, 0.52);
|
|
7226
|
+
border-radius: 999px;
|
|
7227
|
+
color: var(--ctp-teal);
|
|
7228
|
+
background:
|
|
7229
|
+
linear-gradient(120deg, rgba(148, 226, 213, 0.28), rgba(166, 227, 161, 0.10)),
|
|
7230
|
+
var(--ctp-crust);
|
|
7231
|
+
box-shadow: 0 0.42rem 1rem rgba(var(--ctp-crust-rgb), 0.42), 0 0 1rem rgba(148, 226, 213, 0.22);
|
|
7232
|
+
font-size: var(--text-xs);
|
|
7233
|
+
font-weight: 900;
|
|
7234
|
+
letter-spacing: 0.04em;
|
|
7235
|
+
line-height: 1.1;
|
|
7236
|
+
overflow: hidden;
|
|
7237
|
+
text-overflow: ellipsis;
|
|
7238
|
+
white-space: nowrap;
|
|
7239
|
+
}
|
|
7240
|
+
.composer-feature-category-tag.complex-feature {
|
|
7241
|
+
border-color: rgba(203, 166, 247, 0.56);
|
|
7242
|
+
color: var(--ctp-mauve);
|
|
7243
|
+
background:
|
|
7244
|
+
linear-gradient(120deg, rgba(203, 166, 247, 0.28), rgba(137, 180, 250, 0.12)),
|
|
7245
|
+
var(--ctp-crust);
|
|
7246
|
+
box-shadow: 0 0.42rem 1rem rgba(var(--ctp-crust-rgb), 0.42), 0 0 1rem rgba(203, 166, 247, 0.24);
|
|
7247
|
+
}
|
|
7248
|
+
.composer-feature-category-tag[hidden] {
|
|
7249
|
+
display: none !important;
|
|
7250
|
+
}
|
|
7095
7251
|
.composer-conversation-mode-chip {
|
|
7096
7252
|
flex: 0 0 auto;
|
|
7097
7253
|
min-height: 0;
|
|
@@ -8692,6 +8848,177 @@ button.composer-skill-tag:focus-visible {
|
|
|
8692
8848
|
color: var(--text);
|
|
8693
8849
|
box-shadow: 0 2rem 5rem var(--shadow), 0 0 2rem var(--glow-mauve);
|
|
8694
8850
|
}
|
|
8851
|
+
.extension-dialog.workflow-script-dialog {
|
|
8852
|
+
width: min(96rem, calc(100vw - 2rem));
|
|
8853
|
+
height: min(58rem, calc(var(--visual-viewport-height, 100dvh) - 2rem));
|
|
8854
|
+
max-height: calc(var(--visual-viewport-height, 100dvh) - 2rem);
|
|
8855
|
+
overflow: hidden;
|
|
8856
|
+
border-color: rgba(137, 180, 250, 0.54);
|
|
8857
|
+
background:
|
|
8858
|
+
radial-gradient(circle at 100% 0, rgba(148, 226, 213, 0.12), transparent 28rem),
|
|
8859
|
+
linear-gradient(145deg, rgba(var(--ctp-base-rgb), 0.99), rgba(var(--ctp-crust-rgb), 0.99));
|
|
8860
|
+
box-shadow: 0 2rem 5rem var(--shadow), 0 0 2.4rem rgba(137, 180, 250, 0.18);
|
|
8861
|
+
}
|
|
8862
|
+
.workflow-script-dialog form {
|
|
8863
|
+
display: grid;
|
|
8864
|
+
grid-template-rows: auto auto minmax(0, 1fr) auto;
|
|
8865
|
+
gap: 0.75rem;
|
|
8866
|
+
height: 100%;
|
|
8867
|
+
min-height: 0;
|
|
8868
|
+
padding: clamp(0.85rem, 1.8vw, 1.35rem);
|
|
8869
|
+
}
|
|
8870
|
+
.workflow-script-dialog #dialogTitle {
|
|
8871
|
+
margin: 0;
|
|
8872
|
+
color: var(--ctp-blue);
|
|
8873
|
+
text-shadow: 0 0 1rem rgba(137, 180, 250, 0.2);
|
|
8874
|
+
}
|
|
8875
|
+
.workflow-script-dialog #dialogMessage {
|
|
8876
|
+
margin: 0;
|
|
8877
|
+
color: rgba(var(--ctp-subtext-rgb), 0.9);
|
|
8878
|
+
}
|
|
8879
|
+
.workflow-script-dialog #dialogBody {
|
|
8880
|
+
display: flex;
|
|
8881
|
+
min-height: 0;
|
|
8882
|
+
overflow: hidden;
|
|
8883
|
+
}
|
|
8884
|
+
.workflow-script-dialog #dialogActions {
|
|
8885
|
+
margin: 0;
|
|
8886
|
+
padding: 0;
|
|
8887
|
+
}
|
|
8888
|
+
.workflow-script-preview {
|
|
8889
|
+
display: grid;
|
|
8890
|
+
grid-template-rows: auto auto minmax(0, 1fr);
|
|
8891
|
+
gap: 0.65rem;
|
|
8892
|
+
flex: 1 1 auto;
|
|
8893
|
+
min-width: 0;
|
|
8894
|
+
min-height: 0;
|
|
8895
|
+
}
|
|
8896
|
+
.workflow-script-meta {
|
|
8897
|
+
display: flex;
|
|
8898
|
+
flex-wrap: wrap;
|
|
8899
|
+
align-items: center;
|
|
8900
|
+
justify-content: space-between;
|
|
8901
|
+
gap: 0.45rem 0.8rem;
|
|
8902
|
+
min-width: 0;
|
|
8903
|
+
color: rgba(var(--ctp-subtext-rgb), 0.9);
|
|
8904
|
+
font-size: var(--text-sm);
|
|
8905
|
+
}
|
|
8906
|
+
.workflow-script-language {
|
|
8907
|
+
color: var(--ctp-teal);
|
|
8908
|
+
font-weight: 850;
|
|
8909
|
+
}
|
|
8910
|
+
.workflow-script-source-stats {
|
|
8911
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
|
|
8912
|
+
font-variant-numeric: tabular-nums;
|
|
8913
|
+
}
|
|
8914
|
+
.workflow-script-toolbar {
|
|
8915
|
+
display: grid;
|
|
8916
|
+
grid-template-columns: minmax(12rem, 1fr) repeat(4, auto);
|
|
8917
|
+
gap: 0.45rem;
|
|
8918
|
+
align-items: center;
|
|
8919
|
+
min-width: 0;
|
|
8920
|
+
padding: 0.5rem;
|
|
8921
|
+
border: 1px solid rgba(180, 190, 254, 0.2);
|
|
8922
|
+
border-radius: 0.8rem;
|
|
8923
|
+
background: rgba(var(--ctp-crust-rgb), 0.5);
|
|
8924
|
+
}
|
|
8925
|
+
.workflow-script-search {
|
|
8926
|
+
width: 100%;
|
|
8927
|
+
min-width: 0;
|
|
8928
|
+
min-height: 2.4rem;
|
|
8929
|
+
padding: 0.4rem 0.65rem;
|
|
8930
|
+
color: var(--ctp-text);
|
|
8931
|
+
border-color: rgba(137, 180, 250, 0.42);
|
|
8932
|
+
background: rgba(var(--ctp-mantle-rgb), 0.88);
|
|
8933
|
+
}
|
|
8934
|
+
.workflow-script-search:focus-visible {
|
|
8935
|
+
border-color: var(--ctp-teal);
|
|
8936
|
+
box-shadow: 0 0 0 3px rgba(148, 226, 213, 0.18), 0 0 1rem rgba(148, 226, 213, 0.22);
|
|
8937
|
+
}
|
|
8938
|
+
.workflow-script-toolbar button {
|
|
8939
|
+
min-height: 2.4rem;
|
|
8940
|
+
padding: 0.38rem 0.62rem;
|
|
8941
|
+
color: var(--ctp-text);
|
|
8942
|
+
border-color: rgba(180, 190, 254, 0.3);
|
|
8943
|
+
font-size: var(--text-sm);
|
|
8944
|
+
font-weight: 760;
|
|
8945
|
+
white-space: nowrap;
|
|
8946
|
+
}
|
|
8947
|
+
.workflow-script-search-button { color: var(--ctp-blue) !important; }
|
|
8948
|
+
.workflow-script-wrap-button { color: var(--ctp-mauve) !important; }
|
|
8949
|
+
.workflow-script-copy-button { color: var(--ctp-green) !important; }
|
|
8950
|
+
.workflow-script-search-status,
|
|
8951
|
+
.workflow-script-copy-status {
|
|
8952
|
+
grid-column: 1 / -1;
|
|
8953
|
+
min-height: 1.15rem;
|
|
8954
|
+
color: var(--ctp-subtext);
|
|
8955
|
+
font-size: var(--text-xs);
|
|
8956
|
+
font-weight: 720;
|
|
8957
|
+
}
|
|
8958
|
+
.workflow-script-copy-status { color: var(--ctp-green); }
|
|
8959
|
+
.workflow-script-code {
|
|
8960
|
+
min-width: 0;
|
|
8961
|
+
min-height: 0;
|
|
8962
|
+
overflow: auto;
|
|
8963
|
+
overscroll-behavior: contain;
|
|
8964
|
+
scrollbar-gutter: stable both-edges;
|
|
8965
|
+
border: 1px solid rgba(137, 180, 250, 0.28);
|
|
8966
|
+
border-radius: 0.82rem;
|
|
8967
|
+
background: rgba(var(--ctp-crust-rgb), 0.84);
|
|
8968
|
+
box-shadow: inset 0 0 2.2rem rgba(var(--ctp-crust-rgb), 0.44);
|
|
8969
|
+
color: var(--ctp-text);
|
|
8970
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
|
|
8971
|
+
font-size: 0.875rem;
|
|
8972
|
+
line-height: 1.58;
|
|
8973
|
+
}
|
|
8974
|
+
.workflow-script-code:focus-visible {
|
|
8975
|
+
outline: 3px solid rgba(148, 226, 213, 0.72);
|
|
8976
|
+
outline-offset: 2px;
|
|
8977
|
+
box-shadow: inset 0 0 2.2rem rgba(var(--ctp-crust-rgb), 0.44), 0 0 1.2rem rgba(148, 226, 213, 0.18);
|
|
8978
|
+
}
|
|
8979
|
+
.workflow-script-line {
|
|
8980
|
+
display: grid;
|
|
8981
|
+
grid-template-columns: minmax(3.75rem, auto) minmax(0, 1fr);
|
|
8982
|
+
min-width: max-content;
|
|
8983
|
+
border-bottom: 1px solid rgba(180, 190, 254, 0.07);
|
|
8984
|
+
}
|
|
8985
|
+
.workflow-script-line:last-child { border-bottom: 0; }
|
|
8986
|
+
.workflow-script-line-number {
|
|
8987
|
+
position: sticky;
|
|
8988
|
+
left: 0;
|
|
8989
|
+
z-index: 1;
|
|
8990
|
+
padding: 0 0.75rem 0 0.6rem;
|
|
8991
|
+
color: rgba(var(--ctp-subtext-rgb), 0.72);
|
|
8992
|
+
background: rgba(var(--ctp-mantle-rgb), 0.96);
|
|
8993
|
+
font-variant-numeric: tabular-nums;
|
|
8994
|
+
text-align: right;
|
|
8995
|
+
user-select: none;
|
|
8996
|
+
}
|
|
8997
|
+
.workflow-script-line-text {
|
|
8998
|
+
min-width: 0;
|
|
8999
|
+
padding: 0 0.8rem;
|
|
9000
|
+
color: inherit;
|
|
9001
|
+
white-space: pre;
|
|
9002
|
+
}
|
|
9003
|
+
.workflow-script-code.is-wrapped .workflow-script-line { min-width: 100%; }
|
|
9004
|
+
.workflow-script-code.is-wrapped .workflow-script-line-text {
|
|
9005
|
+
white-space: pre-wrap;
|
|
9006
|
+
overflow-wrap: anywhere;
|
|
9007
|
+
}
|
|
9008
|
+
.workflow-script-line.is-search-match { background: rgba(249, 226, 175, 0.12); }
|
|
9009
|
+
.workflow-script-line.is-active-match {
|
|
9010
|
+
background: rgba(137, 180, 250, 0.2);
|
|
9011
|
+
box-shadow: inset 0.22rem 0 0 var(--ctp-teal);
|
|
9012
|
+
}
|
|
9013
|
+
.workflow-script-line.is-active-match .workflow-script-line-number {
|
|
9014
|
+
color: var(--ctp-crust);
|
|
9015
|
+
background: var(--ctp-teal);
|
|
9016
|
+
font-weight: 900;
|
|
9017
|
+
}
|
|
9018
|
+
.workflow-script-token-keyword { color: var(--ctp-mauve); font-weight: 760; }
|
|
9019
|
+
.workflow-script-token-string { color: var(--ctp-green); }
|
|
9020
|
+
.workflow-script-token-number { color: var(--ctp-peach); }
|
|
9021
|
+
.workflow-script-token-comment { color: var(--ctp-subtext); font-style: italic; }
|
|
8695
9022
|
.extension-dialog::backdrop { background: rgba(var(--ctp-crust-rgb), 0.78); backdrop-filter: blur(4px); }
|
|
8696
9023
|
#dialogMessage {
|
|
8697
9024
|
white-space: pre-wrap;
|
|
@@ -10564,6 +10891,7 @@ body.subagent-terminal-active .composer-remote-mic-consent {
|
|
|
10564
10891
|
overflow: auto;
|
|
10565
10892
|
padding: 0.36rem 0.55rem;
|
|
10566
10893
|
}
|
|
10894
|
+
.widget-area:has(.workflow-widget:not(.minimized)) { --workflow-overlay-max-height: 34dvh; }
|
|
10567
10895
|
.widget-area .widget:not(.todo-widget):not(.release-npm-widget) { display: none; }
|
|
10568
10896
|
.release-npm-widget {
|
|
10569
10897
|
gap: 0.45rem;
|
|
@@ -12686,3 +13014,50 @@ html[data-density="compact"] .composer { padding-block: 0.5rem; }
|
|
|
12686
13014
|
.empty-start-context-label { flex-basis: 100%; }
|
|
12687
13015
|
.confirmation-details > div { grid-template-columns: 1fr; gap: 0.2rem; }
|
|
12688
13016
|
}
|
|
13017
|
+
|
|
13018
|
+
@media (max-width: 720px), (max-device-width: 720px), (pointer: coarse) and (hover: none) {
|
|
13019
|
+
.extension-dialog.workflow-script-dialog {
|
|
13020
|
+
inset: calc(0.25rem + env(safe-area-inset-top)) 0 0;
|
|
13021
|
+
width: 100vw;
|
|
13022
|
+
height: calc(var(--visual-viewport-height, 100dvh) - 0.25rem - env(safe-area-inset-top));
|
|
13023
|
+
max-height: calc(var(--visual-viewport-height, 100dvh) - 0.25rem - env(safe-area-inset-top));
|
|
13024
|
+
margin: 0;
|
|
13025
|
+
overflow: hidden;
|
|
13026
|
+
border-radius: 1rem 1rem 0 0;
|
|
13027
|
+
}
|
|
13028
|
+
.workflow-script-dialog form {
|
|
13029
|
+
gap: 0.58rem;
|
|
13030
|
+
padding: 0.75rem 0.7rem calc(0.7rem + env(safe-area-inset-bottom));
|
|
13031
|
+
}
|
|
13032
|
+
.workflow-script-dialog #dialogTitle { font-size: clamp(1.05rem, 5vw, 1.3rem); }
|
|
13033
|
+
.workflow-script-toolbar {
|
|
13034
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
13035
|
+
gap: 0.4rem;
|
|
13036
|
+
}
|
|
13037
|
+
.workflow-script-search,
|
|
13038
|
+
.workflow-script-search-status,
|
|
13039
|
+
.workflow-script-copy-status { grid-column: 1 / -1; }
|
|
13040
|
+
.workflow-script-toolbar button {
|
|
13041
|
+
width: 100%;
|
|
13042
|
+
padding-inline: 0.38rem;
|
|
13043
|
+
font-size: var(--text-xs);
|
|
13044
|
+
}
|
|
13045
|
+
.workflow-script-meta { align-items: start; font-size: var(--text-xs); }
|
|
13046
|
+
.workflow-script-code { font-size: 0.8rem; line-height: 1.5; }
|
|
13047
|
+
.workflow-script-line { grid-template-columns: minmax(3.1rem, auto) minmax(0, 1fr); }
|
|
13048
|
+
.workflow-script-line-number { padding-inline: 0.44rem 0.55rem; }
|
|
13049
|
+
.workflow-script-line-text { padding-inline: 0.58rem; }
|
|
13050
|
+
.workflow-script-dialog #dialogActions {
|
|
13051
|
+
position: static;
|
|
13052
|
+
display: grid;
|
|
13053
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
13054
|
+
gap: 0.5rem;
|
|
13055
|
+
padding-bottom: 0;
|
|
13056
|
+
background: transparent;
|
|
13057
|
+
}
|
|
13058
|
+
.workflow-script-dialog #dialogActions button {
|
|
13059
|
+
min-width: 0;
|
|
13060
|
+
padding-inline: 0.45rem;
|
|
13061
|
+
font-size: var(--text-sm);
|
|
13062
|
+
}
|
|
13063
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { createFastModeOutputEvents } from "./fixtures/fast-mode-output-events.mjs";
|
|
6
|
+
|
|
7
|
+
const root = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
8
|
+
const [app, helper, html, worker, styles, packageRaw] = await Promise.all([
|
|
9
|
+
readFile(join(root, "public", "app.js"), "utf8"),
|
|
10
|
+
readFile(join(root, "public", "fast-output-live.mjs"), "utf8"),
|
|
11
|
+
readFile(join(root, "public", "index.html"), "utf8"),
|
|
12
|
+
readFile(join(root, "public", "service-worker.js"), "utf8"),
|
|
13
|
+
readFile(join(root, "public", "styles.css"), "utf8"),
|
|
14
|
+
readFile(join(root, "package.json"), "utf8"),
|
|
15
|
+
]);
|
|
16
|
+
|
|
17
|
+
function functionBody(source, name) {
|
|
18
|
+
const marker = `function ${name}(`;
|
|
19
|
+
const start = source.indexOf(marker);
|
|
20
|
+
assert.notEqual(start, -1, `${name} should be defined`);
|
|
21
|
+
let parenDepth = 0;
|
|
22
|
+
let open = -1;
|
|
23
|
+
for (let index = start + marker.length - 1; index < source.length; index += 1) {
|
|
24
|
+
if (source[index] === "(") parenDepth += 1;
|
|
25
|
+
else if (source[index] === ")") parenDepth -= 1;
|
|
26
|
+
else if (source[index] === "{" && parenDepth === 0) {
|
|
27
|
+
open = index;
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
assert.notEqual(open, -1, `${name} should open`);
|
|
32
|
+
let depth = 0;
|
|
33
|
+
for (let index = open; index < source.length; index += 1) {
|
|
34
|
+
if (source[index] === "{") depth += 1;
|
|
35
|
+
if (source[index] === "}") {
|
|
36
|
+
depth -= 1;
|
|
37
|
+
if (depth === 0) return source.slice(open + 1, index);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
assert.fail(`${name} should close`);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const connectEvents = functionBody(app, "connectEvents");
|
|
44
|
+
const compactUpdate = functionBody(app, "handleCompactMessageUpdate");
|
|
45
|
+
const compactFlush = functionBody(app, "flushCompactLiveOutput");
|
|
46
|
+
const compactToolShell = functionBody(app, "renderCompactToolShell");
|
|
47
|
+
const resetStream = functionBody(app, "resetStreamBubble");
|
|
48
|
+
const normalToCompact = functionBody(app, "transitionNormalLiveOutputToCompact");
|
|
49
|
+
const compactToNormal = functionBody(app, "transitionCompactLiveOutputToNormal");
|
|
50
|
+
const nativeSettingsDialog = functionBody(app, "openNativeSettingsDialog");
|
|
51
|
+
const nativeSettingsPayload = functionBody(app, "collectNativeSettingsPayload");
|
|
52
|
+
const outputModeMetadataText = functionBody(app, "webuiOutputModeMetadataText");
|
|
53
|
+
const sidebarOutputModeRefresh = functionBody(app, "refreshSidebarOutputMode");
|
|
54
|
+
const sidebarOutputModeApply = functionBody(app, "applySidebarOutputMode");
|
|
55
|
+
|
|
56
|
+
assert.match(app, /from "\.\/fast-output-live\.mjs"/, "browser should import the pure compact live helper");
|
|
57
|
+
assert.match(connectEvents, /outputMode:\s*eventSourceOutputModeRequest/, "all new EventSource connections should negotiate an explicit output mode");
|
|
58
|
+
assert.match(connectEvents, /outputModeProtocol:\s*"1"/, "all new EventSource connections should negotiate protocol 1");
|
|
59
|
+
assert.match(app, /function outputModeAcknowledgement[\s\S]*?outputMode\?\.protocolVersion !== 1[\s\S]*?function acceptOutputModeAcknowledgement[\s\S]*?outputModeAcknowledgement\(event\)[\s\S]*?connectEvents\(activeTabContext\(\), \{ requestedMode: "normal", fallbackAttempted: true \}\)/, "unacknowledged or old servers should receive one normal-mode fallback");
|
|
60
|
+
assert.match(app, /function compactOutputActive\(\) \{\s+return outputModeAcknowledged && activeOutputMode === "compact-v1";/, "compact rendering must remain acknowledgement-gated");
|
|
61
|
+
assert.match(app, /case "webui_output_mode":[\s\S]*?applyOutputModeControl\(event, tabContext\)/, "mode-control events should be handled before subsequent compact representation events");
|
|
62
|
+
assert.match(app, /function applyOutputModeControl[\s\S]*?finishCompactLiveOutput\(tabContext\)[\s\S]*?resetCompactLiveOutput\(\)/, "mode changes should synchronously flush then reset compact state at semantic boundaries");
|
|
63
|
+
assert.match(normalToCompact, /seedFastOutputLiveState\(\{ text: streamRawText, thinking: streamThinkingRawText \}\)/, "normal-to-compact controls should seed pre-switch text and thinking into the compact state");
|
|
64
|
+
assert.match(normalToCompact, /setStreamRawText\(""\)[\s\S]*?setStreamThinkingRawText\(""\)[\s\S]*?removeStreamBubble\(\)[\s\S]*?removeStreamingThinkingBubble\(\)[\s\S]*?flushCompactLiveOutput\(\)/, "normal-to-compact controls should remove stale normal bubbles and synchronously show the seeded compact state");
|
|
65
|
+
assert.match(compactToNormal, /fastOutputLiveTextAndThinking\(compactLiveState\)[\s\S]*?resetCompactLiveOutput\(\)[\s\S]*?setStreamRawText\(live\.text\)[\s\S]*?setStreamThinkingRawText\(live\.thinking\)[\s\S]*?renderStreamingAssistantText\(\)/, "compact-to-normal controls should transfer pre-switch live text/thinking before normal rendering resumes");
|
|
66
|
+
|
|
67
|
+
assert.doesNotMatch(compactUpdate, /event\.message|assistantMessageEvent\.partial|renderStreamingMarkdown|renderMarkdown|syncLiveTodoProgressWidgetFromText/, "compact deltas should consume direct fields without accumulated scans, markdown, or todo extraction");
|
|
68
|
+
assert.match(compactUpdate, /reduceFastOutputLiveEvent\(compactLiveState, event\)/, "compact deltas should use the pure reducer");
|
|
69
|
+
assert.match(compactUpdate, /shouldConsumeFastOutputLiveEvent\(reduced\)/, "recognized compact empty end variants should be consumed instead of reaching normal handlers with stripped snapshots");
|
|
70
|
+
assert.match(helper, /function shouldConsumeFastOutputLiveEvent\(reduction = \{\}\)[\s\S]*?"text-end"[\s\S]*?"thinking-end"[\s\S]*?"toolcall-end"/, "the reducer policy should consume only recognized compact end variants when no DOM state changes");
|
|
71
|
+
assert.match(compactFlush, /\.textContent = compactLiveState\.text/, "compact text must render through a stable plain-text node");
|
|
72
|
+
assert.match(compactFlush, /\.textContent = compactLiveState\.thinking/, "compact thinking must render through a stable plain-text node");
|
|
73
|
+
assert.doesNotMatch(compactFlush, /renderStreamingMarkdown|renderThinkingMarkdown|renderToolExecution|normalizeToolExecution/, "compact flushing must not invoke live rich renderers");
|
|
74
|
+
assert.doesNotMatch(compactToolShell, /normalizeToolExecution|toolExecutionRenderSignature|renderToolExecution|handleToolExecutionUpdate|JSON\.stringify/, "compact tool shells must defer rich bodies and raw serialization");
|
|
75
|
+
assert.match(app, /case "tool_execution_update":\s+if \(!compactOutputActive\(\)\) handleToolExecutionUpdate\(event\);/, "compact mode should not build intermediate rich tool updates");
|
|
76
|
+
assert.match(app, /case "tool_execution_end":[\s\S]*?compactLiveScheduler\.flushNow\(\)[\s\S]*?renderCompactToolShell\(event, \{ complete: true \}\)[\s\S]*?finishCompactLiveOutput\(tabContext\)/, "compact tool completion should remain lightweight and request final reconciliation");
|
|
77
|
+
assert.match(resetStream, /resetCompactLiveOutput\(\)/, "reset and tab changes should cancel compact pending work");
|
|
78
|
+
assert.match(app, /case "message_end": \{\s+if \(compactOutputActive\(\)\) finishCompactLiveOutput\(tabContext\);/, "message ends should synchronously flush compact output before reconciliation");
|
|
79
|
+
assert.match(app, /case "agent_end":\s+if \(compactOutputActive\(\)\) finishCompactLiveOutput\(tabContext\);/, "agent ends should synchronously flush compact output before reconciliation");
|
|
80
|
+
|
|
81
|
+
assert.match(app, /const SETTINGS_OUTPUT_MODE_OPTIONS = \[[\s\S]*?value: "normal"[\s\S]*?value: "compact-v1"/, "settings should offer normal and compact-v1 server defaults");
|
|
82
|
+
assert.match(nativeSettingsDialog, /api\("\/api\/webui-output-mode", \{ scoped: false \}\)/, "opening settings should load output-mode metadata from the separate server API");
|
|
83
|
+
assert.match(nativeSettingsDialog, /outputMode: nativeSettingSelect\("Output processing", outputModeMetadata\.persistedDefault, SETTINGS_OUTPUT_MODE_OPTIONS,[\s\S]*?\{ label: "server", tone: "startup" \}\)/, "Browser workflow should expose a server-badged output-processing selector");
|
|
84
|
+
assert.match(nativeSettingsDialog, /Compact reduces local output-processing and live fidelity, restores rich final output, and does not change model inference or token generation\. Changes use server barriers without restarting Pi\./, "settings copy should bound compact mode to local output processing and preserve inference semantics");
|
|
85
|
+
assert.match(nativeSettingsDialog, /nativeSettingsSection\("Browser workflow"[\s\S]*?controls\.outputMode/, "the output-mode selector should be placed in Browser workflow");
|
|
86
|
+
assert.match(outputModeMetadataText, /Persisted default:[\s\S]*?Effective mode:[\s\S]*?Source:/, "settings should display persisted default plus effective mode and source");
|
|
87
|
+
assert.match(outputModeMetadataText, /metadata\.overridden[\s\S]*?overrides the persisted setting/, "settings should display CLI/environment override state when it wins");
|
|
88
|
+
assert.match(nativeSettingsDialog, /Output-mode API unavailable:[\s\S]*?Showing the normal default; other settings can still be applied\./, "unavailable output-mode API should leave a visible nonfatal normal-default diagnostic");
|
|
89
|
+
assert.match(nativeSettingsDialog, /controls\.outputMode\.select\.disabled = !!outputModeApiDiagnostic/, "unavailable output-mode API should safely prevent an unpersistable mode change");
|
|
90
|
+
assert.match(nativeSettingsDialog, /method: "PUT",[\s\S]*?body: \{ outputModeDefault: controls\.outputMode\.select\.value \},[\s\S]*?scoped: false,[\s\S]*?const refreshedOutputMode = await api\("\/api\/webui-output-mode", \{ scoped: false \}\)/, "changed output defaults should PUT the server payload and then refresh metadata");
|
|
91
|
+
assert.doesNotMatch(nativeSettingsPayload, /outputMode(?:Default|Metadata|ApiDiagnostic|Changed)?/, "server-scoped output mode must stay out of the native SettingsManager payload");
|
|
92
|
+
assert.match(nativeSettingsDialog, /const response = await nativeCommandApi\("\/api\/settings", \{ method: "POST", body: \{ settings: payload, reload \} \}\);[\s\S]*?nativeSettingsChangedMessage\(response, reload\)/, "existing native settings apply behavior should remain intact");
|
|
93
|
+
|
|
94
|
+
assert.match(html, /data-side-panel-section="controls"[\s\S]*?id="outputProcessingControlsTitle">Output processing<[\s\S]*?<span class="control-scope-badge">Server<\/span>[\s\S]*?id="fastOutputModeSelect"[\s\S]*?<option value="normal">Normal<\/option>[\s\S]*?<option value="compact-v1">Fast<\/option>[\s\S]*?id="setFastOutputModeButton"[\s\S]*?id="fastOutputModeStatus"/, "Controls should expose a server-scoped normal/fast selector with apply button and live status");
|
|
95
|
+
assert.match(app, /fastOutputModeSelect: \$\("#fastOutputModeSelect"\)[\s\S]*?setFastOutputModeButton: \$\("#setFastOutputModeButton"\)[\s\S]*?fastOutputModeStatus: \$\("#fastOutputModeStatus"\)/, "sidebar fast-mode elements should be wired");
|
|
96
|
+
assert.match(sidebarOutputModeRefresh, /api\("\/api\/webui-output-mode", \{ scoped: false \}\)[\s\S]*?normalizeWebuiOutputModeMetadata\(response\.data\)/, "sidebar selector should load current server output-mode metadata");
|
|
97
|
+
assert.match(sidebarOutputModeApply, /method: "PUT"[\s\S]*?body: \{ outputModeDefault \}[\s\S]*?scoped: false[\s\S]*?await refreshSidebarOutputMode\(\)/, "sidebar selector should persist the selected mode and refresh effective metadata");
|
|
98
|
+
assert.match(sidebarOutputModeApply, /outputModeDefault === "compact-v1"[\s\S]*?Fast output mode enabled[\s\S]*?Normal output processing restored/, "sidebar apply feedback should distinguish enabling fast mode from restoring normal mode");
|
|
99
|
+
assert.match(sidebarOutputModeApply, /sidebarOutputModeDiagnostic = ""[\s\S]*?sidebarOutputModeNotice = `Failed to update fast mode:[\s\S]*?You can retry\.`[\s\S]*?sidebarOutputModeLoaded = true/, "a transient apply failure should remain visible without permanently disabling retry");
|
|
100
|
+
assert.match(app, /function renderSidebarOutputModeControl[\s\S]*?sidebarOutputModeNotice[\s\S]*?webuiOutputModeMetadataText\(sidebarOutputModeMetadata\)[\s\S]*?updateSidebarOutputModeApplyState\(\)/, "sidebar status should expose retry notices or persisted/effective/source metadata and apply state");
|
|
101
|
+
assert.match(styles, /\.toggle-control-hint\.warning\s*\{[\s\S]*?color: var\(--ctp-yellow\)/, "sidebar output-mode failures should use the warning palette");
|
|
102
|
+
assert.match(app, /fastOutputModeSelect\?\.addEventListener\("change", \(\) => \{[\s\S]*?sidebarOutputModeNotice = ""[\s\S]*?renderSidebarOutputModeControl\(\{ syncSelection: false \}\)[\s\S]*?setFastOutputModeButton\?\.addEventListener\("click", \(\) => applySidebarOutputMode\(\)/, "sidebar selection should clear transient failures and keep Apply retryable");
|
|
103
|
+
assert.match(app, /refreshSidebarOutputMode\(\)\.catch[\s\S]*?initializeTabs\(\)/, "sidebar output mode should initialize with the WebUI");
|
|
104
|
+
|
|
105
|
+
assert.match(helper, /FAST_OUTPUT_FLUSH_INTERVAL_MS = 100/, "the live scheduler should retain the exact 100 ms sustained-output bound");
|
|
106
|
+
assert.match(worker, /pi-webui-pwa-v35[\s\S]*?"\/fast-output-live\.mjs"/, "PWA cache identity and app shell should include the compact helper");
|
|
107
|
+
assert.match(html, /<script type="module" src="\/app\.js\?v=82"><\/script>/, "the PWA entry point should cache-bust browser wiring");
|
|
108
|
+
assert.match(JSON.parse(packageRaw).scripts.check, /node --check public\/fast-output-live\.mjs/, "package checks should parse the compact helper");
|
|
109
|
+
|
|
110
|
+
const events = createFastModeOutputEvents();
|
|
111
|
+
const deltas = events.filter((event) => event?.type === "message_update" && event.assistantMessageEvent?.type === "text_delta");
|
|
112
|
+
const normalScanChars = deltas.reduce((total, event) => total + JSON.stringify(event.message).length + JSON.stringify(event.assistantMessageEvent.partial).length, 0);
|
|
113
|
+
const compactScanChars = deltas.reduce((total, event) => total + event.assistantMessageEvent.delta.length, 0);
|
|
114
|
+
const scanRatio = normalScanChars / compactScanChars;
|
|
115
|
+
const normalFlushes = deltas.length;
|
|
116
|
+
const compactFlushes = Math.ceil(deltas.length / 5); // fixed 20 ms model: first + max one 100 ms flush
|
|
117
|
+
const ledger = { normalScanChars, compactScanChars, scanRatio: Number(scanRatio.toFixed(3)), normalFlushes, compactFlushes, normalDomWrites: normalFlushes, compactDomWrites: compactFlushes };
|
|
118
|
+
assert.ok(scanRatio >= 1.5, `compact browser scan ledger must improve by >= 1.5x: ${JSON.stringify(ledger)}`);
|
|
119
|
+
assert.ok(compactFlushes <= normalFlushes && ledger.compactDomWrites <= ledger.normalDomWrites, `compact modeled flush/DOM work must not increase: ${JSON.stringify(ledger)}`);
|
|
120
|
+
console.log(`fast-mode client ledger ${JSON.stringify(ledger)}`);
|
|
121
|
+
console.log("fast-mode-client-static.test.mjs passed");
|