@firstpick/pi-package-webui 0.5.9 → 0.6.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.
- package/README.md +11 -1
- package/bin/pi-webui.mjs +333 -10
- package/lib/git-worktrees.mjs +5 -1
- package/package.json +2 -2
- package/public/app.js +568 -5
- package/public/index.html +10 -2
- package/public/service-worker.js +2 -1
- package/public/styles.css +158 -4
- package/public/voice-conversation.mjs +466 -0
- package/tests/fixtures/compacting-pi.mjs +0 -0
- package/tests/fixtures/fake-pi.mjs +154 -1
- package/tests/http-endpoints-harness.test.mjs +76 -3
- package/tests/mobile-static.test.mjs +54 -5
- package/tests/voice-conversation.test.mjs +361 -0
package/public/index.html
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<link rel="manifest" href="/manifest.webmanifest" />
|
|
13
13
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
14
14
|
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
|
15
|
-
<link rel="stylesheet" href="/styles.css?v=
|
|
15
|
+
<link rel="stylesheet" href="/styles.css?v=62" />
|
|
16
16
|
</head>
|
|
17
17
|
<body>
|
|
18
18
|
<button id="sidePanelExpandButton" class="side-panel-expand-button" type="button" aria-controls="sidePanel" aria-expanded="false" aria-label="Expand side panel" title="Expand side panel">
|
|
@@ -294,6 +294,10 @@
|
|
|
294
294
|
aria-label="Follow-up: type your message first, then tap this button to send it as a follow-up."
|
|
295
295
|
data-tooltip="Follow-up usage: 1. Type your message in the textarea. 2. Tap Follow-up to send it as a follow-up. Use for extra context or the next request."
|
|
296
296
|
>Follow-up</button>
|
|
297
|
+
<div id="conversationVoiceMenu" class="composer-publish-menu composer-conversation-voice-menu" hidden>
|
|
298
|
+
<button id="conversationVoiceButton" class="composer-publish-button composer-conversation-voice-button" type="button" title="Switch the spoken Piper voice. Voices marked with a size are downloaded when selected; progress shows on the voice chip." aria-label="Conversation voice" aria-haspopup="menu" aria-expanded="false" aria-controls="conversationVoiceMenuPanel"><span id="conversationVoiceButtonLabel">Voice</span></button>
|
|
299
|
+
<div id="conversationVoiceMenuPanel" class="composer-publish-menu-panel composer-conversation-voice-menu-panel" role="menu" aria-label="Conversation voices"></div>
|
|
300
|
+
</div>
|
|
297
301
|
<button id="conversationModeEndButton" class="composer-conversation-end-button" type="button" title="End Natural Conversation Mode for this Pi tab" aria-label="End Natural Conversation Mode" hidden>End conversation</button>
|
|
298
302
|
<button id="abortButton" class="composer-abort-button danger" type="button" title="Hold Esc or the Abort button for 3 seconds to abort the active Pi run" aria-label="Hold Esc or the Abort button for 3 seconds to abort the active Pi run" hidden disabled>Abort</button>
|
|
299
303
|
<button
|
|
@@ -308,6 +312,10 @@
|
|
|
308
312
|
<button id="sendButton" type="submit" class="primary" title="Send prompt">Send</button>
|
|
309
313
|
</div>
|
|
310
314
|
</form>
|
|
315
|
+
<div id="remoteMicStreamingConsent" class="composer-remote-mic-consent" role="alert" hidden>
|
|
316
|
+
<span id="remoteMicStreamingConsentText" class="composer-remote-mic-consent-text"></span>
|
|
317
|
+
<button id="remoteMicStreamingConsentButton" class="composer-remote-mic-consent-button" type="button" aria-describedby="remoteMicStreamingConsentText" disabled>Allow remote microphone streaming</button>
|
|
318
|
+
</div>
|
|
311
319
|
</section>
|
|
312
320
|
|
|
313
321
|
<button id="sidePanelBackdrop" class="side-panel-backdrop" type="button" aria-label="Close side panel" hidden></button>
|
|
@@ -754,6 +762,6 @@
|
|
|
754
762
|
</form>
|
|
755
763
|
</dialog>
|
|
756
764
|
|
|
757
|
-
<script type="module" src="/app.js?v=
|
|
765
|
+
<script type="module" src="/app.js?v=60"></script>
|
|
758
766
|
</body>
|
|
759
767
|
</html>
|
package/public/service-worker.js
CHANGED
package/public/styles.css
CHANGED
|
@@ -5108,9 +5108,73 @@ summary { cursor: pointer; color: var(--warning); }
|
|
|
5108
5108
|
white-space: nowrap;
|
|
5109
5109
|
}
|
|
5110
5110
|
.composer-conversation-mode-chip[hidden],
|
|
5111
|
-
.composer-conversation-end-button[hidden]
|
|
5111
|
+
.composer-conversation-end-button[hidden],
|
|
5112
|
+
.composer-conversation-voice-menu[hidden] {
|
|
5112
5113
|
display: none !important;
|
|
5113
5114
|
}
|
|
5115
|
+
.composer-conversation-voice-button {
|
|
5116
|
+
width: clamp(5.6rem, 14vw, 8.8rem);
|
|
5117
|
+
min-width: 5.6rem;
|
|
5118
|
+
max-width: 8.8rem;
|
|
5119
|
+
color: var(--ctp-teal);
|
|
5120
|
+
border-color: rgba(148, 226, 213, 0.44);
|
|
5121
|
+
background:
|
|
5122
|
+
linear-gradient(120deg, rgba(148, 226, 213, 0.14), rgba(166, 227, 161, 0.08)),
|
|
5123
|
+
var(--ctp-crust);
|
|
5124
|
+
}
|
|
5125
|
+
.composer-conversation-voice-button > span {
|
|
5126
|
+
display: block;
|
|
5127
|
+
min-width: 0;
|
|
5128
|
+
max-width: 100%;
|
|
5129
|
+
overflow: hidden;
|
|
5130
|
+
text-overflow: ellipsis;
|
|
5131
|
+
white-space: nowrap;
|
|
5132
|
+
}
|
|
5133
|
+
.composer-conversation-voice-button:disabled {
|
|
5134
|
+
opacity: 0.55;
|
|
5135
|
+
cursor: progress;
|
|
5136
|
+
}
|
|
5137
|
+
.composer-conversation-voice-menu-panel {
|
|
5138
|
+
width: min(22rem, calc(100vw - 2rem));
|
|
5139
|
+
min-width: min(16rem, calc(100vw - 2rem));
|
|
5140
|
+
}
|
|
5141
|
+
.composer-conversation-voice-item {
|
|
5142
|
+
justify-content: flex-start;
|
|
5143
|
+
width: 100%;
|
|
5144
|
+
min-width: 0;
|
|
5145
|
+
max-width: 100%;
|
|
5146
|
+
color: var(--ctp-teal);
|
|
5147
|
+
border-color: rgba(148, 226, 213, 0.30);
|
|
5148
|
+
background:
|
|
5149
|
+
linear-gradient(120deg, rgba(148, 226, 213, 0.12), rgba(166, 227, 161, 0.08)),
|
|
5150
|
+
var(--ctp-crust);
|
|
5151
|
+
line-height: 1.2;
|
|
5152
|
+
overflow-wrap: anywhere;
|
|
5153
|
+
text-align: left;
|
|
5154
|
+
white-space: normal;
|
|
5155
|
+
}
|
|
5156
|
+
.composer-conversation-voice-item.active {
|
|
5157
|
+
border-color: rgba(148, 226, 213, 0.78);
|
|
5158
|
+
box-shadow: 0 0 0.8rem rgba(148, 226, 213, 0.28);
|
|
5159
|
+
}
|
|
5160
|
+
.composer-conversation-voice-item.pending,
|
|
5161
|
+
.composer-conversation-voice-notice {
|
|
5162
|
+
color: var(--ctp-green);
|
|
5163
|
+
border-color: rgba(166, 227, 161, 0.50);
|
|
5164
|
+
cursor: progress;
|
|
5165
|
+
white-space: normal;
|
|
5166
|
+
}
|
|
5167
|
+
.composer-conversation-voice-notice.error {
|
|
5168
|
+
color: var(--ctp-red);
|
|
5169
|
+
border-color: rgba(243, 139, 168, 0.55);
|
|
5170
|
+
cursor: default;
|
|
5171
|
+
}
|
|
5172
|
+
.composer-conversation-voice-item:hover,
|
|
5173
|
+
.composer-conversation-voice-item:focus-visible {
|
|
5174
|
+
color: #11111b;
|
|
5175
|
+
border-color: transparent;
|
|
5176
|
+
background: linear-gradient(120deg, var(--ctp-teal), var(--ctp-green));
|
|
5177
|
+
}
|
|
5114
5178
|
.composer-conversation-mode-chip:hover,
|
|
5115
5179
|
.composer-conversation-mode-chip:focus-visible {
|
|
5116
5180
|
border-color: rgba(148, 226, 213, 0.78);
|
|
@@ -5652,7 +5716,7 @@ button.composer-skill-tag:focus-visible {
|
|
|
5652
5716
|
display: flex;
|
|
5653
5717
|
}
|
|
5654
5718
|
.composer-options-menu-panel {
|
|
5655
|
-
max-height: min(calc(var(--visual-viewport-height, 100dvh) - 2rem),
|
|
5719
|
+
max-height: min(calc(var(--visual-viewport-height, 100dvh) - 2rem), 48rem);
|
|
5656
5720
|
}
|
|
5657
5721
|
.composer-publish-menu.open .composer-publish-button {
|
|
5658
5722
|
border-color: rgba(250, 179, 135, 0.58);
|
|
@@ -8982,8 +9046,21 @@ button.workspace-dashboard-chip {
|
|
|
8982
9046
|
max-height: inherit;
|
|
8983
9047
|
min-height: 0;
|
|
8984
9048
|
}
|
|
8985
|
-
.edit-retry-dialog
|
|
9049
|
+
.edit-retry-dialog {
|
|
8986
9050
|
width: min(44rem, calc(100vw - 2rem));
|
|
9051
|
+
max-height: calc(var(--visual-viewport-height, 100dvh) - 2rem);
|
|
9052
|
+
overflow: hidden;
|
|
9053
|
+
}
|
|
9054
|
+
.edit-retry-dialog form {
|
|
9055
|
+
display: grid;
|
|
9056
|
+
grid-template-rows: auto auto minmax(0, 1fr) auto auto;
|
|
9057
|
+
width: 100%;
|
|
9058
|
+
max-height: calc(var(--visual-viewport-height, 100dvh) - 4rem);
|
|
9059
|
+
min-height: 0;
|
|
9060
|
+
}
|
|
9061
|
+
.edit-retry-dialog h2,
|
|
9062
|
+
.edit-retry-dialog p {
|
|
9063
|
+
min-width: 0;
|
|
8987
9064
|
}
|
|
8988
9065
|
.command-palette-header {
|
|
8989
9066
|
display: flex;
|
|
@@ -9133,8 +9210,15 @@ button.workspace-dashboard-chip {
|
|
|
9133
9210
|
}
|
|
9134
9211
|
.edit-retry-text {
|
|
9135
9212
|
width: 100%;
|
|
9136
|
-
min-
|
|
9213
|
+
min-width: 0;
|
|
9214
|
+
min-height: min(12rem, 38vh);
|
|
9215
|
+
max-height: min(32rem, 48vh);
|
|
9137
9216
|
margin-top: 0.65rem;
|
|
9217
|
+
overflow-x: hidden;
|
|
9218
|
+
overflow-y: auto;
|
|
9219
|
+
overflow-wrap: anywhere;
|
|
9220
|
+
white-space: pre-wrap;
|
|
9221
|
+
word-break: break-word;
|
|
9138
9222
|
}
|
|
9139
9223
|
.edit-retry-status.error { color: var(--ctp-red); }
|
|
9140
9224
|
.edit-retry-status.info { color: var(--ctp-subtext); }
|
|
@@ -9272,3 +9356,73 @@ button.workspace-dashboard-chip {
|
|
|
9272
9356
|
padding-right: 5rem;
|
|
9273
9357
|
}
|
|
9274
9358
|
}
|
|
9359
|
+
|
|
9360
|
+
/* Natural Conversation browser voice loop (Phase 3): per-state chip accents
|
|
9361
|
+
and the remote microphone consent banner. */
|
|
9362
|
+
.composer-conversation-mode-chip[data-voice-state="speaking"] {
|
|
9363
|
+
color: var(--ctp-green);
|
|
9364
|
+
border-color: rgba(166, 227, 161, 0.6);
|
|
9365
|
+
box-shadow: 0 0 0.55rem rgba(166, 227, 161, 0.35);
|
|
9366
|
+
}
|
|
9367
|
+
.composer-conversation-mode-chip[data-voice-state="transcribing"],
|
|
9368
|
+
.composer-conversation-mode-chip[data-voice-state="answering"] {
|
|
9369
|
+
color: var(--ctp-blue);
|
|
9370
|
+
border-color: rgba(137, 180, 250, 0.55);
|
|
9371
|
+
}
|
|
9372
|
+
.composer-conversation-mode-chip[data-voice-state="interrupting"],
|
|
9373
|
+
.composer-conversation-mode-chip[data-voice-state="silence"] {
|
|
9374
|
+
color: var(--ctp-yellow);
|
|
9375
|
+
border-color: rgba(249, 226, 175, 0.6);
|
|
9376
|
+
}
|
|
9377
|
+
.composer-conversation-mode-chip[data-voice-state="paused"],
|
|
9378
|
+
.composer-conversation-mode-chip[data-voice-state="error"] {
|
|
9379
|
+
color: var(--ctp-red);
|
|
9380
|
+
border-color: rgba(243, 139, 168, 0.62);
|
|
9381
|
+
box-shadow: 0 0 0.55rem rgba(243, 139, 168, 0.3);
|
|
9382
|
+
}
|
|
9383
|
+
|
|
9384
|
+
.composer-remote-mic-consent {
|
|
9385
|
+
display: flex;
|
|
9386
|
+
flex-wrap: wrap;
|
|
9387
|
+
align-items: center;
|
|
9388
|
+
gap: 0.55rem;
|
|
9389
|
+
margin: 0.5rem 0.75rem 0.65rem;
|
|
9390
|
+
padding: 0.6rem 0.75rem;
|
|
9391
|
+
border: 1px solid rgba(250, 179, 135, 0.55);
|
|
9392
|
+
border-radius: 0.65rem;
|
|
9393
|
+
background: linear-gradient(135deg, rgba(250, 179, 135, 0.14), rgba(243, 139, 168, 0.1)), var(--ctp-crust);
|
|
9394
|
+
box-shadow: 0 0 0.65rem rgba(250, 179, 135, 0.22);
|
|
9395
|
+
}
|
|
9396
|
+
.composer-remote-mic-consent[hidden] {
|
|
9397
|
+
display: none !important;
|
|
9398
|
+
}
|
|
9399
|
+
.composer-remote-mic-consent-text {
|
|
9400
|
+
flex: 1 1 16rem;
|
|
9401
|
+
min-width: 0;
|
|
9402
|
+
color: var(--ctp-peach);
|
|
9403
|
+
font-size: 0.74rem;
|
|
9404
|
+
line-height: 1.4;
|
|
9405
|
+
overflow-wrap: anywhere;
|
|
9406
|
+
}
|
|
9407
|
+
.composer-remote-mic-consent-button {
|
|
9408
|
+
flex: 0 0 auto;
|
|
9409
|
+
padding: 0.42rem 0.8rem;
|
|
9410
|
+
border: 1px solid rgba(250, 179, 135, 0.6);
|
|
9411
|
+
border-radius: 999px;
|
|
9412
|
+
background: linear-gradient(135deg, rgba(250, 179, 135, 0.24), rgba(243, 139, 168, 0.18)), var(--ctp-crust);
|
|
9413
|
+
color: var(--ctp-peach);
|
|
9414
|
+
font-size: 0.72rem;
|
|
9415
|
+
font-weight: 800;
|
|
9416
|
+
letter-spacing: 0.04em;
|
|
9417
|
+
text-transform: uppercase;
|
|
9418
|
+
cursor: pointer;
|
|
9419
|
+
}
|
|
9420
|
+
.composer-remote-mic-consent-button:hover:not(:disabled),
|
|
9421
|
+
.composer-remote-mic-consent-button:focus-visible:not(:disabled) {
|
|
9422
|
+
background: linear-gradient(135deg, var(--ctp-peach), var(--ctp-maroon));
|
|
9423
|
+
color: #11111b;
|
|
9424
|
+
}
|
|
9425
|
+
.composer-remote-mic-consent-button:disabled {
|
|
9426
|
+
opacity: 0.55;
|
|
9427
|
+
cursor: not-allowed;
|
|
9428
|
+
}
|