From fdf9fb0399840b66369c5373399bc63934e48290 Mon Sep 17 00:00:00 2001 From: JereC4str0 Date: Wed, 29 Apr 2026 03:35:54 +0000 Subject: [PATCH 1/5] feat(voice): add voice-chat web UI served at /voice - voice-chat.html: Web Speech API (STT + TTS), WebSocket chat, mic hold-to-talk - server.js: add GET /voice endpoint to serve the UI - Connects directly to bot server WS /ws and POST /chat/send --- agents/bot/server.js | 11 ++ agents/bot/voice-chat.html | 340 +++++++++++++++++++++++++++++++++++++ 2 files changed, 351 insertions(+) create mode 100644 agents/bot/voice-chat.html diff --git a/agents/bot/server.js b/agents/bot/server.js index 06792b16..eb17f03d 100644 --- a/agents/bot/server.js +++ b/agents/bot/server.js @@ -3427,6 +3427,17 @@ const httpServer = http.createServer(async (req, res) => { } } + if (path === '/voice') { + const htmlPath = new URL('voice-chat.html', import.meta.url).pathname; + try { + const html = fs.readFileSync(htmlPath, 'utf8'); + res.writeHead(200, { 'Content-Type': 'text/html', 'Access-Control-Allow-Origin': '*' }); + return res.end(html); + } catch { + return respond(res, 500, { ok: false, error: 'voice-chat.html not found' }); + } + } + if (path === '/blueprints') { try { const files = fs.readdirSync(BLUEPRINTS_DIR).filter(f => f.endsWith('.json')); diff --git a/agents/bot/voice-chat.html b/agents/bot/voice-chat.html new file mode 100644 index 00000000..4d01e22e --- /dev/null +++ b/agents/bot/voice-chat.html @@ -0,0 +1,340 @@ + + + + + + DaemonCraft Voice Chat + + + +
+

🎙️ DaemonCraft Voice

+
+
+ Conectando... +
+
+ +
+ +
+
+ +
Mantené presionado el botón, hablá, y soltá
+
+ +
+ + + + +
+ + + + From 81bbb38bdc7dbbf3ba2f14014439092d868f45b4 Mon Sep 17 00:00:00 2001 From: JereC4str0 Date: Wed, 29 Apr 2026 04:19:45 +0000 Subject: [PATCH 2/5] fix(voice-chat): dynamic URL inputs, default port 3002, deduplicate messages - Read API/WS URLs from inputs in real time instead of caching on load - Reconnect WebSocket automatically when URL inputs change - Update default URLs from 3001 to 3002 - Clear chat history on each WS message to prevent duplicate accumulation (server broadcasts full chatLog slice on every message) --- agents/bot/voice-chat.html | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/agents/bot/voice-chat.html b/agents/bot/voice-chat.html index 4d01e22e..d6a45471 100644 --- a/agents/bot/voice-chat.html +++ b/agents/bot/voice-chat.html @@ -170,14 +170,16 @@

🎙️ DaemonCraft Voice

- + - +