feat: desacoplar launcher del registro estatico de agentes
Introduce un registro global de reglas en agents/registry.go con Register() y GetRules(). Cada paquete de agente se auto-registra via init(), eliminando la necesidad de editar manualmente el map rulesRegistry en cmd/launcher/main.go. Cambios: - agents/registry.go: nuevo registro global con sync.RWMutex - agents/*/agent.go: cada agente llama agents.Register() en init() - agents/_template/agent.go: placeholder AGENT_ID_PLACEHOLDER para scaffold - cmd/launcher/main.go: elimina rulesRegistry, usa blank imports + agents.GetRules() para obtener reglas por agent ID Patron: init() + blank import (estandar Go: database/sql, image codecs) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,9 +3,14 @@
|
||||
package asistente2
|
||||
|
||||
import (
|
||||
"github.com/enmanuel/agents/agents"
|
||||
"github.com/enmanuel/agents/pkg/decision"
|
||||
)
|
||||
|
||||
func init() {
|
||||
agents.Register("asistente-2", Rules)
|
||||
}
|
||||
|
||||
// Rules returns the decision rules for the asistente-2 bot.
|
||||
// Note: !help is now handled by the built-in command system.
|
||||
func Rules() []decision.Rule {
|
||||
|
||||
Reference in New Issue
Block a user