Files
agents_and_robots/agents/asistente-2/agent.go
T
egutierrez 0cd7e36a14 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>
2026-04-08 23:00:08 +00:00

31 lines
790 B
Go

// Package asistente2 defines the pure rules for the asistente-2 bot.
// This agent uses tool_use (current_time) to demonstrate the tool-use loop.
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 {
return []decision.Rule{
// Any DM or mention → LLM (with tool-use enabled)
{
Name: "llm-all",
Match: func(ctx decision.MessageContext) bool {
return ctx.IsDirectMsg || ctx.IsMention
},
Actions: []decision.Action{{
Kind: decision.ActionKindLLM,
LLM: &decision.LLMAction{},
}},
},
}
}