Server-side agent loop that adapts the CLI kernel to work over WebSocket. Three new modules: stuck detection, LLM provider abstraction (OpenAI/Groq/ OpenRouter), and the main perception-reasoning-action loop. Also wires up the goals route to start agent loops with duplicate-device protection. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>