feat: FRIDAY Voice stack on the GPU machine; VoiceCoach history

FRIDAY Voice (speaches GPU STT/TTS + hermes agent + push-to-talk console) on
.150 Docker Desktop, fronted by coach.hobbs.farm. Also captures the VoiceCoach
compose/agent trees and deploy notes it replaced, which had never been committed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-11 11:19:04 -05:00
parent dddc6734d0
commit 266ea11447
29 changed files with 4494 additions and 0 deletions
@@ -0,0 +1,8 @@
FROM nginx:alpine
COPY index.html /usr/share/nginx/html/
COPY app.js /usr/share/nginx/html/
COPY style.css /usr/share/nginx/html/
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
@@ -0,0 +1,158 @@
const LIVEKIT_URL = "wss://voice.hobbs.farm";
let room = null;
function log(msg, level) {
const el = document.getElementById("logOutput");
const time = new Date().toLocaleTimeString();
const cls = level === "error" ? "log-error" : level === "warn" ? "log-warn" : "log-info";
el.innerHTML += `<div class="${cls}"><span class="log-time">${time}</span> ${msg}</div>`;
el.scrollTop = el.scrollHeight;
}
function clearLog() {
document.getElementById("logOutput").innerHTML = "";
}
async function connect() {
setStatus("connecting", "Connecting...");
log("Requesting token from server...");
try {
const response = await fetch("/api/token", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ identity: "jeremy-" + Date.now() }),
});
if (!response.ok) {
const text = await response.text();
throw new Error("Token request failed: " + response.status + " " + text);
}
const data = await response.json();
log("Token received. LiveKit URL: " + data.url);
room = new LivekitClient.Room({
audioCaptureDefaults: {
echoCancellation: true,
noiseSuppression: true,
autoGainControl: true,
},
});
room.on(LivekitClient.RoomEvent.Connected, () => {
setStatus("connected", "Connected");
document.getElementById("connectBtn").style.display = "none";
document.getElementById("disconnectBtn").style.display = "block";
log("Connected to LiveKit room");
log("Participants in room: " + room.remoteParticipants.size);
if (room.remoteParticipants.size === 0) {
log("No agent participant yet - waiting for voicecoach-agent to join...", "warn");
}
});
room.on(LivekitClient.RoomEvent.Disconnected, (reason) => {
setStatus("disconnected", "Disconnected");
document.getElementById("connectBtn").style.display = "block";
document.getElementById("disconnectBtn").style.display = "none";
log("Disconnected from LiveKit" + (reason ? ": " + reason : ""), "warn");
});
room.on(LivekitClient.RoomEvent.ParticipantConnected, (participant) => {
log("Participant joined: " + participant.identity);
});
room.on(LivekitClient.RoomEvent.ParticipantDisconnected, (participant) => {
log("Participant left: " + participant.identity, "warn");
});
room.on(LivekitClient.RoomEvent.TrackSubscribed, (track, publication, participant) => {
log("Track subscribed: " + track.kind + " from " + participant.identity);
if (track.kind === LivekitClient.Track.Kind.Audio) {
const element = track.attach();
document.body.appendChild(element);
element.play().then(() => {
log("Audio playback started");
}).catch((err) => {
log("Audio play failed: " + err.message, "error");
});
}
});
room.on(LivekitClient.RoomEvent.TrackPublished, (publication, participant) => {
log("Track published by " + participant.identity + ": " + publication.kind);
});
room.on(LivekitClient.RoomEvent.TrackUnsubscribed, (track, publication, participant) => {
log("Track unsubscribed: " + track.kind + " from " + participant.identity, "warn");
});
room.on(LivekitClient.RoomEvent.DataReceived, (payload, participant) => {
try {
const msg = new TextDecoder().decode(payload);
log("Data from " + (participant ? participant.identity : "server") + ": " + msg);
} catch (e) {
log("Data received (binary, " + payload.byteLength + " bytes)");
}
});
room.on(LivekitClient.RoomEvent.ConnectionQualityChanged, (quality, participant) => {
if (participant.isLocal) {
log("Connection quality: " + quality);
}
});
room.on(LivekitClient.RoomEvent.MediaDevicesError, (err) => {
log("Media device error: " + err.message, "error");
});
room.on(LivekitClient.RoomEvent.RoomMetadataChanged, (metadata) => {
log("Room metadata changed: " + metadata);
});
log("Connecting to " + LIVEKIT_URL + "...");
await room.connect(data.url || LIVEKIT_URL, data.token);
log("Enabling microphone...");
await room.localParticipant.setMicrophoneEnabled(true);
log("Microphone enabled. Speak now.");
// Log local tracks
room.localParticipant.audioTrackPublications.forEach((pub) => {
log("Local audio track: " + pub.trackSid + " muted=" + pub.isMuted);
});
} catch (err) {
setStatus("disconnected", "Error: " + err.message);
log("Connection error: " + err.message, "error");
console.error(err);
}
}
async function disconnect() {
if (room) {
log("Disconnecting...");
await room.disconnect();
room = null;
}
}
function setMode(mode) {
document.getElementById("modeDisplay").textContent = "Mode: " + mode;
log("Mode changed to: " + mode);
if (room && room.localParticipant) {
const encoder = new TextEncoder();
room.localParticipant.publishData(
encoder.encode(JSON.stringify({ type: "mode_change", mode })),
{ reliable: true }
);
}
}
function setStatus(state, text) {
const el = document.getElementById("status");
el.className = "status " + state;
el.textContent = text;
}
document.getElementById("connectBtn").addEventListener("click", connect);
document.getElementById("disconnectBtn").addEventListener("click", disconnect);
log("VoiceCoach client loaded. Ready to connect.");
@@ -0,0 +1,46 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<title>VoiceCoach</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<div class="header">
<h1>VoiceCoach</h1>
<div id="status" class="status disconnected">Disconnected</div>
</div>
<div class="controls">
<button id="connectBtn" class="btn btn-primary">Start Session</button>
<button id="disconnectBtn" class="btn btn-danger" style="display:none">End Session</button>
</div>
<div id="modeDisplay" class="mode-display">Mode: coaching</div>
<div id="transcript" class="transcript">
<p class="hint">Press "Start Session" to connect your voice.</p>
</div>
<div class="mode-buttons">
<button class="mode-btn" onclick="setMode('coaching mode')">Coaching</button>
<button class="mode-btn" onclick="setMode('vent mode')">Vent</button>
<button class="mode-btn" onclick="setMode('practice mode')">Practice</button>
<button class="mode-btn" onclick="setMode('briefing mode')">Briefing</button>
</div>
<div class="log-panel">
<div class="log-header">
<span>Log</span>
<button class="log-clear" onclick="clearLog()">Clear</button>
</div>
<div id="logOutput" class="log-output"></div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/livekit-client/dist/livekit-client.umd.min.js"></script>
<script src="app.js"></script>
</body>
</html>
@@ -0,0 +1,15 @@
server {
listen 80;
root /usr/share/nginx/html;
index index.html;
location /api/ {
proxy_pass http://pipecat-agent:8080/;
proxy_http_version 1.1;
proxy_set_header Host $host;
}
location / {
try_files $uri $uri/ /index.html;
}
}
@@ -0,0 +1,131 @@
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background: #1a1a2e;
color: #eee;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
.container {
max-width: 420px;
width: 100%;
padding: 24px;
}
.header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 24px;
}
h1 { font-size: 24px; font-weight: 600; }
.status {
padding: 4px 12px;
border-radius: 12px;
font-size: 12px;
font-weight: 600;
text-transform: uppercase;
}
.status.disconnected { background: #444; color: #aaa; }
.status.connecting { background: #553; color: #ffa; }
.status.connected { background: #253; color: #5f5; }
.controls { margin-bottom: 20px; }
.btn {
width: 100%;
padding: 14px;
border: none;
border-radius: 8px;
font-size: 16px;
font-weight: 600;
cursor: pointer;
transition: opacity 0.2s;
}
.btn:hover { opacity: 0.85; }
.btn-primary { background: #4a6cf7; color: #fff; }
.btn-danger { background: #f74a4a; color: #fff; }
.mode-display {
text-align: center;
font-size: 13px;
color: #888;
margin-bottom: 16px;
}
.transcript {
background: #16213e;
border-radius: 8px;
padding: 16px;
min-height: 200px;
max-height: 400px;
overflow-y: auto;
margin-bottom: 16px;
}
.transcript .hint { color: #666; font-style: italic; }
.mode-buttons {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 8px;
}
.mode-btn {
padding: 10px;
background: #16213e;
border: 1px solid #333;
border-radius: 6px;
color: #ccc;
font-size: 13px;
cursor: pointer;
transition: background 0.2s;
}
.mode-btn:hover { background: #1a2744; border-color: #4a6cf7; }
.log-panel {
margin-top: 16px;
background: #0d1117;
border: 1px solid #333;
border-radius: 8px;
overflow: hidden;
}
.log-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 6px 12px;
background: #161b22;
font-size: 12px;
font-weight: 600;
color: #888;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.log-clear {
background: none;
border: 1px solid #444;
border-radius: 4px;
color: #888;
font-size: 11px;
padding: 2px 8px;
cursor: pointer;
}
.log-clear:hover { border-color: #666; color: #ccc; }
.log-output {
padding: 8px 12px;
max-height: 200px;
overflow-y: auto;
font-family: 'SF Mono', 'Fira Code', monospace;
font-size: 11px;
line-height: 1.6;
}
.log-output div { word-break: break-all; }
.log-time { color: #555; margin-right: 6px; }
.log-info { color: #8b949e; }
.log-warn { color: #d29922; }
.log-error { color: #f85149; }