Commit Graph

33 Commits

Author SHA1 Message Date
egutierrez 7176afde0a feat: update orchestrator for enhanced multi-bot management and room discovery 2026-03-06 17:03:08 +00:00
egutierrez 2f89943511 chore: move completed tasks to completed/ directory
Mueve las tareas completadas (01-bot-tools, 02-bot-memory, 04-bot-avatar)
al directorio .claude/tasks/completed/ para organización.
Añade nueva tarea 06.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 09:06:25 +00:00
egutierrez b86da0b805 refactor: update dev-scripts for unified launcher model
Actualiza todos los scripts de desarrollo para el modelo de launcher unificado.
Ya no se inician procesos individuales por agente — un solo proceso corre todos.

_common.sh: helpers para launcher unificado (is_launcher_running, read_launcher_pid,
launcher_pid_file/log_file), agent_status() ahora deriva estado del launcher
start.sh: inicia el launcher unificado (sin -c flag, descubre todos los agentes)
stop.sh: detiene el launcher unificado
restart.sh: stop + start del launcher
ps.sh: muestra stats del proceso launcher + lista de agentes enabled/disabled
logs.sh: tail -f del log unificado del launcher
server.sh: añade comandos enable/disable para gestionar agentes, elimina start/stop por agente
remove.sh: simplificado a toggle enabled:false + sugerencia de restart

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 09:06:11 +00:00
egutierrez 1af0457c1f feat: update dashboard and process manager for unified launcher
Actualiza el dashboard TUI y el process manager para el modelo de launcher
unificado donde todos los agentes corren en un solo proceso.

Dashboard (pkg/tui):
- model.go: campos de estado del launcher (PID, uptime, memory, CPU, log size)
- model.go: ServerMenuOptions(running) contextual, AgentActionOptions(enabled)
- messages.go: MsgAgentsLoaded incluye estado del launcher, MsgServerActionDone/MsgRebuildDone simplificados
- update.go: intents nuevos (Enable/Disable agent, Start/Stop/Restart/Kill launcher)
- view.go: vista de servidor muestra stats del launcher, agentes muestran enabled/disabled

Shell adapter (shell/tui):
- adapter.go: reescrito para usar métodos unificados (StartUnified, StopUnified, ToggleEnabled, StatusAllUnified, UnifiedStats, UnifiedLogTail)

Process manager (shell/process):
- manager.go: métodos StartUnified, StopUnified, KillUnified, IsUnifiedRunning, UnifiedPID, UnifiedStats, UnifiedLogTail, StatusAllUnified, ToggleEnabled

Los agentes ya no se inician/detienen individualmente desde el dashboard.
Se habilitan/deshabilitan en config y se reinicia el launcher para aplicar.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 09:05:57 +00:00
egutierrez 2667af52cc feat: implement multi-bot orchestration system with LLM routing
Implementa el sistema de orquestación para salas Matrix con múltiples bots.
El orquestador es un "special agent" sin identidad Matrix que coordina qué bot
responde y cuándo, usando LLM (Claude) para routing y evaluación de calidad.

Cambios principales:
- pkg/orchestration/task.go: tipos puros (TaskEvent, BotResponse, QualityScore, RoutingDecision)
- shell/orchestration/: runtime del orquestador (orchestrator.go, router.go, evaluator.go)
- agents/specials/orchestrator/: config + prompts (routing, quality, refinement)
- internal/config/: SpecialConfig, OrchestrationCfg, LoadSpecial()
- shell/bus/bus.go: protocolo request-reply (SendAndWait, Reply) para delegación
- shell/matrix/listener.go: InterceptFunc para interceptar eventos en salas orquestadas
- agents/runtime.go: SetBus, listenBus, handleTaskEvent para recibir tareas del orquestador
- cmd/launcher/main.go: creación de bus compartido, arranque del orquestador antes de bots

Incluye deduplicación para evitar que múltiples listeners en la misma sala
disparen el orquestador más de una vez por mensaje.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 09:05:42 +00:00
egutierrez 6bef4283c6 Remove outdated plans and implement new features for bot tools, memory, interaction, avatar management, and cron scheduling
- Deleted old plan files for bot memory, interaction, avatar, and cron.
- Added new task files for bot tools, memory, interaction, avatar, and cron scheduling with detailed designs and implementation notes.
- Updated `agents/runtime.go` to support memory clearing and message deletion from SQLite.
- Created necessary shell and package files for implementing bot tools and cron scheduling functionalities.
2026-03-06 01:18:53 +00:00
egutierrez df714c44dd docs: update references after agent directory rename and devops removal
Actualizar todas las referencias en documentación para reflejar los
nuevos nombres de directorio (assistant-bot, asistente-2) y la
eliminación del agente devops-bot. Archivos actualizados: CLAUDE.md,
create_agent.md, README.md, e2ee.md, creating-agents.md,
03-bot-interaction.md.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 00:55:20 +00:00
egutierrez 1a649fdcb2 chore: remove devops-bot agent
Eliminar el agente devops-bot completo (directorio agents/devops/,
código, config y prompt). El agente nunca llegó a estar activo y se
decide eliminarlo para mantener limpio el proyecto. Se elimina también
la referencia al room devops en config/matrix.yaml.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 00:55:14 +00:00
egutierrez 08dcb332b7 refactor: rename agent directories to match agent IDs
Renombrar directorios de agentes para que coincidan exactamente con el
agent.id del config.yaml, eliminando la disonancia entre nombres:
- agents/assistant/ → agents/assistant-bot/ (ID: assistant-bot)
- agents/asistente2/ → agents/asistente-2/ (ID: asistente-2)

Se actualizan los imports en cmd/launcher/main.go, los store_path de
crypto, los paths de storage/logs/audit en ambos configs para que
apunten a ./agents/<agent-id>/data/. También se corrige el memory.db
que se creaba en directorios fantasma fuera del directorio real del
agente.

Se eliminan las referencias a devops-bot en el config de assistant-bot
(peers, delegation).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 00:55:09 +00:00
egutierrez cb9489e633 feat: implement memory management system with SQLite persistence, including conversation windows and episodic facts 2026-03-06 00:39:22 +00:00
egutierrez d26be78c46 feat: add rebuild and restart functionality for agents, including build process and status reporting 2026-03-06 00:13:15 +00:00
egutierrez f2626f7007 Refactor code structure for improved readability and maintainability 2026-03-05 23:52:58 +00:00
egutierrez a92fbff801 feat: update access token environment variables and enhance device signing process for E2EE agents; add verification script and system flow documentation 2026-03-05 23:46:07 +00:00
egutierrez 0f900d1560 feat: add recovery key support for E2EE agents, including configuration and documentation updates 2026-03-05 00:56:15 +00:00
egutierrez fc234bcb92 feat: add E2EE diagnostics logging and testing support for crypto initialization 2026-03-05 00:41:01 +00:00
egutierrez a7e28b0267 feat: add testing support for crypto initialization and process management, including auto-recovery and filtering of go wrapper processes 2026-03-05 00:28:01 +00:00
egutierrez 54fe479792 feat: implement end-to-end encryption (E2EE) support for agents with configuration and documentation updates 2026-03-05 00:06:32 +00:00
egutierrez 1e5103eb70 feat: enhance agent management with support for multiple instances and update UI accordingly 2026-03-04 23:41:26 +00:00
egutierrez bcbbd974e3 docs: add agent creation guide and LLM policies index
Documentación y políticas para la creación de agentes:

- docs/creating-agents.md: guía completa paso a paso para humanos
  (scaffold, config, registro Matrix, avatar, verificación E2EE, arranque,
  troubleshooting)
- .claude/policies/create_agent.md: policy para LLMs con estructura de
  archivos, convenciones y reglas a seguir al crear agentes
- .claude/policies/index.md: índice de todas las policies disponibles
- .claude/policies/create_tool.md: movido desde .claude/rules/ (misma policy)
- CLAUDE.md: añadida sección de políticas, actualizada tabla de agentes
  con asistente-2, y actualizado el flujo de "Cómo añadir un nuevo bot"
  con pasos de avatar y verificación E2EE

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 21:39:11 +00:00
egutierrez 6ad8a6e04e fix: support digits in env var names in load_env regex
La regex del loader de .env solo aceptaba [A-Z_] en nombres de variables,
lo que excluía vars como MATRIX_TOKEN_ASISTENTE2 (con dígito).

Cambiado ^[A-Z_]+=.+ → ^[A-Z_][A-Z0-9_]*=.+ para soportar dígitos
después del primer carácter.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 21:39:01 +00:00
egutierrez dd4a101139 feat: add asistente-2 agent with tool-use and E2EE verification
Nuevo agente asistente-2 con herramienta current_time habilitada para
demostrar el flujo completo de tool-use (LLM → tool call → resultado → respuesta).

Incluye:
- agents/asistente2/: reglas puras, config con tool_use.enabled, system prompt
- tools/time.go: herramienta current_time (siempre disponible para todos los agentes)
- cmd/verify/: comando para subir cross-signing keys y eliminar el warning
  "Encrypted by a device not verified by its owner"
- Registro en runtime.go (current_time) y launcher/main.go (rulesRegistry)

El cmd/verify usa mautrix GenerateAndUploadCrossSigningKeysWithPassword
para configurar cross-signing via UIA con la password del bot.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 21:38:55 +00:00
egutierrez 0f8d2f9ca0 feat: implement tool registry and add various tools for HTTP, file operations, SSH, and Matrix messaging 2026-03-04 21:10:29 +00:00
egutierrez ddec55871b feat: implement server-wide management actions and enhance TUI dashboard 2026-03-04 20:51:02 +00:00
egutierrez 150f9d2990 chore: track agentctl avatar and displayname commands
Añade avatar.go que implementa los subcomandos avatar y displayname
de agentctl. Ya existía en el proyecto pero no estaba commiteado.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 19:38:44 +00:00
egutierrez f5b857dbc6 feat: add bubbletea TUI dashboard for bot server management
Implementa un dashboard interactivo con bubbletea siguiendo el patrón
pure core / impure shell del proyecto:

- pkg/tui/ (PURE): Model, Update, View — solo fmt y strings, cero I/O.
  Update produce Intent[] (datos puros) en vez de side effects.
- shell/tui/ (IMPURE): Adapter convierte Intent[] en tea.Cmd[] con I/O real
  (process management, /proc stats, log tail).
- cmd/dashboard/ (composición): Bridge conecta pure Update con shell Adapter
  usando la Elm Architecture de bubbletea.

Pantallas: Main Menu → Agent List → Agent Actions (start/stop/restart/kill) → Logs.
Navegación: flechas ↑↓, Enter seleccionar, 0 volver, q salir.

Dependencias añadidas: bubbletea, lipgloss.
Actualiza .gitignore para anclar binarios a raíz (/agentctl, /dashboard).
Documenta nuevos scripts en CLAUDE.md.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 19:38:30 +00:00
egutierrez 00dac8b77f refactor: extract process management to shell/process package
Extrae toda la lógica de gestión de procesos (scan, start, stop, kill, stats,
log tail) de cmd/agentctl/main.go a shell/process/manager.go como paquete
reutilizable siguiendo el patrón impure shell del proyecto.

agentctl queda como thin wrapper sobre process.Manager — misma funcionalidad,
mismo comportamiento. El nuevo paquete será compartido por el TUI dashboard.

Añade funcionalidad nueva al Manager: Stats() para métricas de /proc,
LogTail() para últimas N líneas, Stop() con espera graceful + SIGKILL fallback.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 19:38:19 +00:00
egutierrez 791cea7db0 feat: add dev-scripts for server management and TUI launcher
Añade scripts de gestión del servidor de bots:
- ps.sh: vista detallada de procesos (PID, uptime, memoria, CPU, tamaño log)
- restart.sh: reinicio de uno o todos los agentes (stop + start)
- server.sh: comando unificado (start|stop|restart|status|ps|logs|kill|dashboard)
- dashboard.sh: lanzador del TUI interactivo

Estos scripts complementan los existentes (start.sh, stop.sh, list.sh) y
permiten gestionar todo el servidor desde un solo punto de entrada.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 19:37:39 +00:00
egutierrez 062dac268f Refactor code structure for improved readability and maintainability 2026-03-04 19:02:34 +00:00
egutierrez e900464dd6 feat: add plans for bot tools, memory, interaction, avatar editing, and cron scheduling 2026-03-04 01:56:04 +00:00
egutierrez 0701089ecf chore: remove binaries from tracking, clean up .gitignore
- Remove launcher binary from all git history (git-filter-repo)
- Add launcher, run/*.pid, run/*.log to .gitignore
- Remove tracked run/assistant-bot.pid (runtime file)
- Add dev-scripts/reset-password.sh

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 01:41:45 +00:00
egutierrez 396fc39b90 bot contesta con e2ee 2026-03-04 00:59:10 +00:00
egutierrez bd8e1432e5 feat: add assistant bot with LLM integration and configuration
- Implemented the assistant bot with basic command handling and LLM routing.
- Created configuration file for the assistant bot with personality, behavior, and LLM settings.
- Added system prompt for the assistant bot to define its capabilities and limitations.
- Developed registration script for creating Matrix bot users via Synapse admin API.
- Introduced common development scripts for agent management (start, stop, list, logs).
- Scaffolded new agent creation script to streamline the addition of new agents.
- Implemented agent removal script to disable agents without deleting data.
2026-03-03 23:57:13 +00:00
egutierrez c126187c5a Repo iniciado 2026-03-03 23:19:23 +00:00