feat: implement full UPDATE.md review — critical fixes, UI upgrade, infra hardening
Critical frontend bugs: - Add TrackSubscribed/attach() for agent audio playback - Fix decodeToString TypeError with TextDecoder - XSS fix: innerHTML -> textContent in addMessage - Fresh token on reconnect retry Agent fixes: - GemmaLLM subclass with reasoning_content fallback wrapper - Disable Gemma 4 thinking mode via chat_template_kwargs (6.8s -> 0.5s) - Remove duplicate session-level LLM - Replace global _active_session with closure-based handler - asyncio.create_task instead of deprecated get_event_loop - Explicit silero VAD, topic filter on voice-control Infra: - supervisord: all programs log to /dev/stdout - Dockerfile: uv sync --frozen with committed uv.lock - nginx config moved to real file, token_server.py no longer served - entrypoint.sh: cert persisted, only regenerated on IP change - compose: healthcheck + cert volume - token_server: CORS removed, room pinned to voice-room UI upgrade: - Orb UI with state machine (idle/connecting/listening/thinking/speaking) - Streaming transcripts via lk.transcription text streams - Barge-in hint, thinking chip, audio visualizer - Glassmorphism, chat bubbles, settings sheet, light mode - PWA manifest, favicon, wake-lock, safe-area insets - localStorage conversation history Docs: AGENTS.md drift fixed
This commit is contained in:
+407
-61
@@ -1,14 +1,48 @@
|
||||
:root {
|
||||
--bg: #09090b;
|
||||
--panel: rgba(255, 255, 255, 0.05);
|
||||
--panel-strong: rgba(255, 255, 255, 0.08);
|
||||
--border: rgba(255, 255, 255, 0.09);
|
||||
--text: #e4e4e7;
|
||||
--text-dim: #a1a1aa;
|
||||
--text-faint: #71717a;
|
||||
--accent-1: #60a5fa;
|
||||
--accent-2: #a78bfa;
|
||||
--user-bubble: rgba(96, 165, 250, 0.14);
|
||||
--agent-bubble: rgba(167, 139, 250, 0.14);
|
||||
--danger: #ef4444;
|
||||
color-scheme: dark;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: light) {
|
||||
:root {
|
||||
--bg: #fafafa;
|
||||
--panel: rgba(0, 0, 0, 0.04);
|
||||
--panel-strong: rgba(0, 0, 0, 0.07);
|
||||
--border: rgba(0, 0, 0, 0.1);
|
||||
--text: #18181b;
|
||||
--text-dim: #52525b;
|
||||
--text-faint: #a1a1aa;
|
||||
--user-bubble: rgba(37, 99, 235, 0.1);
|
||||
--agent-bubble: rgba(124, 58, 237, 0.1);
|
||||
color-scheme: light;
|
||||
}
|
||||
}
|
||||
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
|
||||
html, body { height: 100%; }
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
||||
background: #0f1117;
|
||||
color: #e4e4e7;
|
||||
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
padding: 2rem 1rem;
|
||||
padding: calc(2rem + env(safe-area-inset-top)) calc(1rem + env(safe-area-inset-right))
|
||||
calc(2rem + env(safe-area-inset-bottom)) calc(1rem + env(safe-area-inset-left));
|
||||
}
|
||||
|
||||
.container {
|
||||
@@ -18,28 +52,143 @@ body {
|
||||
|
||||
header {
|
||||
text-align: center;
|
||||
margin-bottom: 2rem;
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 2rem;
|
||||
font-weight: 700;
|
||||
background: linear-gradient(135deg, #60a5fa, #a78bfa);
|
||||
background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
color: #71717a;
|
||||
color: var(--text-faint);
|
||||
margin-top: 0.5rem;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
/* ── Orb ─────────────────────────────────────────────────────────────────── */
|
||||
.orb-stage {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin-bottom: 1.75rem;
|
||||
}
|
||||
|
||||
.orb {
|
||||
--pulse-scale: 1;
|
||||
position: relative;
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
}
|
||||
|
||||
.orb-core {
|
||||
width: 130px;
|
||||
height: 130px;
|
||||
border-radius: 50%;
|
||||
background: radial-gradient(circle at 35% 30%, var(--accent-1), var(--accent-2) 70%);
|
||||
box-shadow:
|
||||
0 0 60px 8px color-mix(in srgb, var(--accent-2) 45%, transparent),
|
||||
inset 0 0 30px rgba(255, 255, 255, 0.15);
|
||||
transform: scale(var(--pulse-scale));
|
||||
transition: box-shadow 0.3s ease;
|
||||
animation: breathe 4s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.orb-ring {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
border-radius: 50%;
|
||||
border: 1px solid color-mix(in srgb, var(--accent-2) 35%, transparent);
|
||||
opacity: var(--pulse-opacity, 0.35);
|
||||
transform: scale(var(--pulse-scale));
|
||||
transition: opacity 0.2s ease;
|
||||
}
|
||||
|
||||
/* Per-state glow */
|
||||
.orb[data-state="idle"] .orb-core {
|
||||
filter: saturate(0.5) brightness(0.75);
|
||||
box-shadow: 0 0 30px 4px color-mix(in srgb, var(--accent-2) 25%, transparent);
|
||||
}
|
||||
|
||||
.orb[data-state="connecting"] .orb-core {
|
||||
animation-duration: 1.6s;
|
||||
filter: saturate(0.8) brightness(0.9);
|
||||
}
|
||||
|
||||
.orb[data-state="listening"] .orb-core {
|
||||
box-shadow: 0 0 70px 12px color-mix(in srgb, var(--accent-1) 55%, transparent),
|
||||
inset 0 0 30px rgba(255, 255, 255, 0.18);
|
||||
}
|
||||
|
||||
.orb[data-state="thinking"] .orb-core {
|
||||
animation-duration: 2s;
|
||||
filter: saturate(1.1) brightness(1.05);
|
||||
box-shadow: 0 0 75px 14px color-mix(in srgb, var(--accent-2) 60%, transparent),
|
||||
inset 0 0 30px rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.orb[data-state="speaking"] .orb-core {
|
||||
animation: none;
|
||||
box-shadow: 0 0 90px 18px color-mix(in srgb, var(--accent-1) 65%, transparent),
|
||||
inset 0 0 34px rgba(255, 255, 255, 0.22);
|
||||
}
|
||||
|
||||
@keyframes breathe {
|
||||
0%, 100% { transform: scale(calc(var(--pulse-scale) * 1)); }
|
||||
50% { transform: scale(calc(var(--pulse-scale) * 1.05)); }
|
||||
}
|
||||
|
||||
.orb-labels {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 0.4rem;
|
||||
margin-top: 1rem;
|
||||
min-height: 3.6rem;
|
||||
}
|
||||
|
||||
.state-label {
|
||||
font-size: 0.85rem;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
color: var(--text-dim);
|
||||
}
|
||||
|
||||
.thinking-chip {
|
||||
font-size: 0.75rem;
|
||||
padding: 0.25rem 0.75rem;
|
||||
border-radius: 999px;
|
||||
background: var(--panel-strong);
|
||||
border: 1px solid var(--border);
|
||||
color: var(--text-dim);
|
||||
animation: chipPulse 1.4s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@keyframes chipPulse {
|
||||
0%, 100% { opacity: 0.55; }
|
||||
50% { opacity: 1; }
|
||||
}
|
||||
|
||||
.barge-hint {
|
||||
font-size: 0.75rem;
|
||||
color: var(--text-faint);
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
/* ── Controls ────────────────────────────────────────────────────────────── */
|
||||
.controls {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
gap: 0.75rem;
|
||||
justify-content: center;
|
||||
margin-bottom: 1.5rem;
|
||||
align-items: center;
|
||||
margin-bottom: 1.25rem;
|
||||
}
|
||||
|
||||
.btn {
|
||||
@@ -50,6 +199,7 @@ h1 {
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
.btn:disabled {
|
||||
@@ -68,7 +218,7 @@ h1 {
|
||||
}
|
||||
|
||||
.btn-danger {
|
||||
background: #ef4444;
|
||||
background: var(--danger);
|
||||
color: white;
|
||||
}
|
||||
|
||||
@@ -76,98 +226,294 @@ h1 {
|
||||
background: #dc2626;
|
||||
}
|
||||
|
||||
.voice-panel {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
justify-content: center;
|
||||
margin-bottom: 1.5rem;
|
||||
padding: 1rem;
|
||||
background: #1c1e26;
|
||||
border-radius: 8px;
|
||||
.btn-icon {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
padding: 0;
|
||||
border-radius: 50%;
|
||||
background: var(--panel);
|
||||
color: var(--text-dim);
|
||||
border: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.voice-panel label {
|
||||
font-weight: 600;
|
||||
color: #a1a1aa;
|
||||
.btn-icon:hover {
|
||||
color: var(--text);
|
||||
background: var(--panel-strong);
|
||||
}
|
||||
|
||||
.voice-panel select {
|
||||
padding: 0.5rem 1rem;
|
||||
background: #27272a;
|
||||
color: #e4e4e7;
|
||||
border: 1px solid #3f3f46;
|
||||
.btn-ghost {
|
||||
background: transparent;
|
||||
color: var(--text-faint);
|
||||
padding: 0.4rem 0.75rem;
|
||||
font-size: 0.8rem;
|
||||
border-radius: 6px;
|
||||
font-size: 0.9rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.voice-panel select:focus {
|
||||
outline: none;
|
||||
border-color: #3b82f6;
|
||||
.btn-ghost:hover {
|
||||
color: var(--text);
|
||||
background: var(--panel-strong);
|
||||
}
|
||||
|
||||
/* ── Status + mic meter ──────────────────────────────────────────────────── */
|
||||
.status {
|
||||
text-align: center;
|
||||
padding: 0.75rem;
|
||||
background: #1c1e26;
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 8px;
|
||||
margin-bottom: 1.5rem;
|
||||
margin-bottom: 0.6rem;
|
||||
font-size: 0.9rem;
|
||||
color: #a1a1aa;
|
||||
color: var(--text-dim);
|
||||
}
|
||||
|
||||
.mic-meter {
|
||||
height: 4px;
|
||||
background: var(--panel-strong);
|
||||
border-radius: 2px;
|
||||
margin-bottom: 1.5rem;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.mic-meter-fill {
|
||||
display: block;
|
||||
height: 100%;
|
||||
width: 0%;
|
||||
background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
|
||||
border-radius: 2px;
|
||||
transition: width 0.1s linear;
|
||||
}
|
||||
|
||||
/* ── Transcript ──────────────────────────────────────────────────────────── */
|
||||
.transcript {
|
||||
background: #1c1e26;
|
||||
border-radius: 8px;
|
||||
background: var(--panel);
|
||||
backdrop-filter: blur(12px);
|
||||
-webkit-backdrop-filter: blur(12px);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 12px;
|
||||
padding: 1rem;
|
||||
max-height: 50vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.transcript-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-weight: 700;
|
||||
color: #a1a1aa;
|
||||
color: var(--text-dim);
|
||||
margin-bottom: 1rem;
|
||||
font-size: 0.85rem;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
}
|
||||
|
||||
.message {
|
||||
padding: 0.6rem 0.8rem;
|
||||
margin-bottom: 0.5rem;
|
||||
border-radius: 6px;
|
||||
.message-row {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
gap: 0.5rem;
|
||||
margin-bottom: 0.6rem;
|
||||
position: relative;
|
||||
animation: msgIn 120ms ease-out;
|
||||
}
|
||||
|
||||
@keyframes msgIn {
|
||||
from { opacity: 0; transform: translateY(6px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
|
||||
.message-row.user {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.avatar-dot {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
border-radius: 50%;
|
||||
background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
|
||||
flex-shrink: 0;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.bubble {
|
||||
max-width: 78%;
|
||||
padding: 0.6rem 0.9rem;
|
||||
border-radius: 14px;
|
||||
font-size: 0.95rem;
|
||||
line-height: 1.5;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.message.user {
|
||||
background: #1e3a5f;
|
||||
border-left: 3px solid #3b82f6;
|
||||
.message-row.user .bubble {
|
||||
background: var(--user-bubble);
|
||||
border-bottom-right-radius: 4px;
|
||||
}
|
||||
|
||||
.message.agent {
|
||||
background: #2d1f4e;
|
||||
border-left: 3px solid #a78bfa;
|
||||
.message-row.agent .bubble {
|
||||
background: var(--agent-bubble);
|
||||
border-bottom-left-radius: 4px;
|
||||
}
|
||||
|
||||
.message.system {
|
||||
background: #27272a;
|
||||
color: #71717a;
|
||||
font-style: italic;
|
||||
font-size: 0.85rem;
|
||||
.bubble.partial {
|
||||
opacity: 0.55;
|
||||
}
|
||||
|
||||
.role {
|
||||
/* Timestamps on hover (CSS only, from data-ts attribute) */
|
||||
.message-row::after {
|
||||
content: attr(data-ts);
|
||||
position: absolute;
|
||||
bottom: -1.1rem;
|
||||
font-size: 0.68rem;
|
||||
color: var(--text-faint);
|
||||
opacity: 0;
|
||||
transition: opacity 0.15s ease;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.message-row:hover::after {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.message-row.user::after {
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.message-row.agent::after {
|
||||
left: 2rem;
|
||||
}
|
||||
|
||||
/* ── Agent audio visualizer (bars on latest agent bubble) ─────────────────── */
|
||||
.audio-viz {
|
||||
display: inline-flex;
|
||||
align-items: flex-end;
|
||||
gap: 2px;
|
||||
height: 14px;
|
||||
margin-left: 0.6rem;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.audio-viz i {
|
||||
width: 3px;
|
||||
height: 15%;
|
||||
border-radius: 2px;
|
||||
background: linear-gradient(180deg, var(--accent-2), var(--accent-1));
|
||||
opacity: 0.8;
|
||||
transition: height 0.08s linear;
|
||||
}
|
||||
|
||||
/* ── Settings sheet (voice picker) ───────────────────────────────────────── */
|
||||
.sheet-backdrop {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
z-index: 90;
|
||||
opacity: 0;
|
||||
transition: opacity 0.2s ease;
|
||||
}
|
||||
|
||||
.sheet-backdrop:not([hidden]) {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.settings-sheet {
|
||||
position: fixed;
|
||||
left: 50%;
|
||||
bottom: 0;
|
||||
transform: translate(-50%, 100%);
|
||||
width: 100%;
|
||||
max-width: 680px;
|
||||
max-height: 75vh;
|
||||
background: var(--panel-strong);
|
||||
backdrop-filter: blur(12px);
|
||||
-webkit-backdrop-filter: blur(12px);
|
||||
border: 1px solid var(--border);
|
||||
border-bottom: none;
|
||||
border-radius: 16px 16px 0 0;
|
||||
padding: 0.75rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom));
|
||||
z-index: 100;
|
||||
transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.settings-sheet.open {
|
||||
transform: translate(-50%, 0);
|
||||
}
|
||||
|
||||
.sheet-handle {
|
||||
width: 36px;
|
||||
height: 4px;
|
||||
border-radius: 2px;
|
||||
background: var(--border);
|
||||
margin: 0 auto 0.75rem;
|
||||
}
|
||||
|
||||
.sheet-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.sheet-header h2 {
|
||||
font-size: 1.1rem;
|
||||
font-weight: 700;
|
||||
margin-right: 0.5rem;
|
||||
}
|
||||
|
||||
.message.user .role { color: #60a5fa; }
|
||||
.message.agent .role { color: #a78bfa; }
|
||||
.voice-list {
|
||||
overflow-y: auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
padding-right: 0.25rem;
|
||||
}
|
||||
|
||||
/* Scrollbar */
|
||||
.transcript::-webkit-scrollbar { width: 6px; }
|
||||
.transcript::-webkit-scrollbar-track { background: transparent; }
|
||||
.transcript::-webkit-scrollbar-thumb { background: #3f3f46; border-radius: 3px; }
|
||||
.voice-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 0.75rem;
|
||||
padding: 0.8rem 1rem;
|
||||
border-radius: 10px;
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--border);
|
||||
cursor: pointer;
|
||||
transition: all 0.15s ease;
|
||||
}
|
||||
|
||||
.voice-card:hover {
|
||||
background: var(--panel-strong);
|
||||
}
|
||||
|
||||
.voice-card.active {
|
||||
border-color: color-mix(in srgb, var(--accent-2) 60%, transparent);
|
||||
background: var(--agent-bubble);
|
||||
}
|
||||
|
||||
.voice-name {
|
||||
font-size: 0.95rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* ── Scrollbar ───────────────────────────────────────────────────────────── */
|
||||
.transcript::-webkit-scrollbar,
|
||||
.voice-list::-webkit-scrollbar { width: 6px; }
|
||||
.transcript::-webkit-scrollbar-track,
|
||||
.voice-list::-webkit-scrollbar-track { background: transparent; }
|
||||
.transcript::-webkit-scrollbar-thumb,
|
||||
.voice-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
|
||||
|
||||
/* ── Reduced motion ──────────────────────────────────────────────────────── */
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.orb-core,
|
||||
.thinking-chip,
|
||||
.message-row,
|
||||
.settings-sheet,
|
||||
.sheet-backdrop,
|
||||
.audio-viz i,
|
||||
.mic-meter-fill {
|
||||
animation: none !important;
|
||||
transition: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user