Files
agents_and_robots/agents
egutierrez ee8e74be1b refactor: separar runtime.go en archivos por responsabilidad
Divide agents/runtime.go (1188 lineas) en 5 archivos especializados:

- runtime.go (350 lineas): struct Agent, New(), Run(), Stop(), lifecycle
- handler.go: handleEvent(), executeActions(), command routing, bus, sanitizacion
- llm.go: runLLM(), tool-use loop, system prompt, initLLM(), prompt-commands
- memory.go: ensureWindowLoaded(), appendToWindow(), persistMessage(), ClearWindow()
- registry_build.go: buildToolRegistry(), initToolDeps(), initRateLimiter()

Zero cambios en API publica. Todos los metodos siguen siendo del struct Agent,
solo viven en archivos separados por responsabilidad.

Funciones helper extraidas de New() para reducir su tamaño:
- initCrypto(): inicializacion E2EE
- initLLM(): cliente LLM con fallback
- initMemoryStore(): store SQLite + window size
- initToolDeps(): knowledge, MCP, skills
- initRateLimiter(): rate limiting de tools

Reduccion: 1188 → 350 lineas en runtime.go (70% menos).
2026-04-08 23:17:12 +00:00
..