Skip to content

Voice only pr - #1

Open
JereC4str0 wants to merge 5 commits into
nicoechaniz:mainfrom
JereC4str0:voice-only-pr
Open

Voice only pr#1
JereC4str0 wants to merge 5 commits into
nicoechaniz:mainfrom
JereC4str0:voice-only-pr

Conversation

@JereC4str0

Copy link
Copy Markdown

Feature: Voice Chat Web UI

Agrega una interfaz web de voz para hablarle al bot sin escribir en el chat de Minecraft.

Que incluye

- agents/bot/voice-chat.html — UI completa con Web Speech API (reconocimiento de voz en español), push-to-talk, WebSocket en tiempo real, y anti-duplicación de mensajes.
- agents/bot/server.js — Nuevo endpoint GET /voice para servir la UI desde el bot server.
- docs/Voice_Chat.md — Documentación con el apartado de integración con el agente.

Como funciona con el agente

El flujo clave es el campo as en POST /chat/send:

1. El usuario habla por el micrófono en el navegador.
2. La UI envía POST /chat/send { message: "...", as: "PlayerName" }.
3. El bot server detecta que as es distinto del nombre del bot y usa /tellraw para inyectar el mensaje con el nombre del jugador.
4. El mensaje se broadcastea por WebSocket.
5. agent_loop.py lo recibe como un mensaje de jugador válido y dispara un turno.

Sin el campo as, el mensaje saldría como del bot mismo y el agente lo filtraría (evitando loops infinitos).

Por que no toca el core

- agent_loop.py no se modifica — reusa el pipeline de chat existente.
- docker-compose.yml, datapacks y configs quedan intactos.
- Solo se agregan archivos nuevos + 11 líneas en server.js para el endpoint.

Como probar

1. Levantar el bot server (node agents/bot/server.js).
2. Abrir http://localhost:3001/voice en Chrome/Edge.
3. Ingresar tu nombre de jugador de Minecraft (debe ser distinto al nombre del bot).
4. Mantener el botón del micrófono, hablar, soltar.
5. Verificar que el agente responde en el chat del juego.

Notas

- Los inputs de URL (API y WS) son dinámicos — se pueden cambiar sin recargar la página.
- La UI reconecta automáticamente si el WebSocket se cae.
- TTS está desactivado por defecto (demasiado ruidoso en testing).

JereC4str0 added 5 commits May 1, 2026 05:38
- 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
…essages

- 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)
voice-chat.html was sending POST /chat/send without the 'as' field,
so messages appeared as coming from HermesBot itself. The agent filters
out messages from the bot username, so voice input was silently ignored.

- Add player name input field (default: JereC4str0)
- Include 'as' field in the POST body so the bot server routes the
  message via /tellraw with the player's name
- Agent now receives voice messages as chat triggers from the player

Also gave OP to JereC4str0 and ViejoMafic via rcon-cli.
nicoechaniz added a commit that referenced this pull request May 31, 2026
…te, interoception

Implements all 4 priority fixes from the Claude+Grok forum review (2026-05-31):

1. GAP #5 — L4 judge verdict feedback into next heartbeat
   - agent_loop.py: extract l4_verdict from /judge/pending, compact format
   - daemoncraft.py: inject [L4 last] line into heartbeat prompt
   - server.js: judgeAction sets initiator='l4_agent' + ts for seconds_ago

2. GAP #1+#2 — Registry normalization + real cancellation
   - action-registry.js: REG_KEY alias helper + direct aliases for dig/place/collect/place_fill
   - mutex.js: stopDigging() + ON_ABORT dispatch with 750ms timeout + performance.now()
   - server.js: REG_KEY in /action wrapper, ON_ABORT in /action/stop finally block

3. GAP #3+#4 — Auto-eat gated behind ENABLE_AUTO_EAT_PLUGIN env var
   - server.js: plugin load + config wrapped in feature flag (default: disabled)
   - runner/thread.py: ensure eat path works with plugin disabled

4. Interoception enrichment — body_activity block in heartbeat
   - agent_loop.py: compact body_activity string from runner + action data
   - daemoncraft.py: [Body] line in prompt

Tests: registry-normalization.test.js (10 tests), test_l4_verdict_injection.py

Co-authored-by: Grok Build <grok@x.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant