feat: enriquecer comando !info con metadata completa

Fase 4: Comando !info enriquecido
- Mostrar identidad completa (nombre, ID, version, descripcion, tags)
- Mostrar personalidad (rol, tono, formalidad, tipo, humor)
- Mostrar LLM (provider, modelo, tool_use config)
- Mostrar tools disponibles (total + lista de nombres si <= 20)
- Mostrar skills (si estan habilitadas + categorias + cantidad)
- Mostrar knowledge (privado/compartido)
- Mostrar memoria (window size)
- Mostrar schedules (cantidad de cron jobs)
- Mostrar uptime

El comando !info ahora proporciona una vista completa y estructurada
de las capacidades y configuracion del agente.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-03-08 22:30:26 +00:00
parent e743a3e982
commit ffa0911235
+103 -2
View File
@@ -144,15 +144,116 @@ func (a *Agent) cmdStatus(_ context.Context, _ decision.MessageContext) string {
return b.String()
}
// cmdInfo shows agent name, version, and description.
// cmdInfo shows agent metadata, personality, capabilities, and configuration.
func (a *Agent) cmdInfo(_ context.Context, _ decision.MessageContext) string {
var b strings.Builder
// === Identidad ===
b.WriteString("## Identidad\n\n")
fmt.Fprintf(&b, "- **Nombre:** %s\n", a.cfg.Agent.Name)
fmt.Fprintf(&b, "- **ID:** %s\n", a.cfg.Agent.ID)
fmt.Fprintf(&b, "- **ID:** `%s`\n", a.cfg.Agent.ID)
if a.cfg.Agent.Version != "" {
fmt.Fprintf(&b, "- **Version:** %s\n", a.cfg.Agent.Version)
}
fmt.Fprintf(&b, "- **Descripcion:** %s\n", a.cfg.Agent.Description)
if len(a.cfg.Agent.Tags) > 0 {
fmt.Fprintf(&b, "- **Tags:** %v\n", a.cfg.Agent.Tags)
}
// === Personalidad ===
if a.personality.Role != "" || a.personality.Communication.Personality != "" {
b.WriteString("\n## Personalidad\n\n")
if a.personality.Role != "" {
fmt.Fprintf(&b, "- **Rol:** %s\n", a.personality.Role)
}
if a.personality.Tone != "" {
fmt.Fprintf(&b, "- **Tono:** %s\n", a.personality.Tone)
}
if a.personality.Communication.Formality != "" {
fmt.Fprintf(&b, "- **Formalidad:** %s\n", a.personality.Communication.Formality)
}
if a.personality.Communication.Personality != "" {
fmt.Fprintf(&b, "- **Tipo:** %s\n", a.personality.Communication.Personality)
}
if a.personality.Communication.Humor != "" && a.personality.Communication.Humor != "none" {
fmt.Fprintf(&b, "- **Humor:** %s\n", a.personality.Communication.Humor)
}
}
// === LLM ===
if a.cfg.LLM.Primary.Provider != "" {
b.WriteString("\n## LLM\n\n")
fmt.Fprintf(&b, "- **Provider:** %s\n", a.cfg.LLM.Primary.Provider)
fmt.Fprintf(&b, "- **Modelo:** %s\n", a.cfg.LLM.Primary.Model)
if a.cfg.LLM.ToolUse.Enabled {
fmt.Fprintf(&b, "- **Tools:** habilitadas (max %d iteraciones)\n", a.cfg.LLM.ToolUse.MaxIterations)
}
}
// === Tools ===
toolCount := a.toolReg.Len()
if toolCount > 0 {
b.WriteString("\n## Tools disponibles\n\n")
fmt.Fprintf(&b, "- **Total:** %d tools\n", toolCount)
// Lista de tools (nombres)
toolNames := a.toolReg.Names()
if len(toolNames) > 0 && len(toolNames) <= 20 {
b.WriteString("- **Lista:** ")
for i, name := range toolNames {
if i > 0 {
b.WriteString(", ")
}
fmt.Fprintf(&b, "`%s`", name)
}
b.WriteString("\n")
}
}
// === Skills ===
if a.cfg.Skills.Enabled {
b.WriteString("\n## Skills\n\n")
b.WriteString("- **Habilitadas:** si\n")
if len(a.cfg.Skills.Categories) > 0 {
fmt.Fprintf(&b, "- **Categorias:** %v\n", a.cfg.Skills.Categories)
}
if a.skillLoader != nil {
if metas, err := a.skillLoader.LoadMeta(); err == nil {
fmt.Fprintf(&b, "- **Cantidad:** %d skills\n", len(metas))
}
}
}
// === Knowledge ===
hasPrivate := a.cfg.Tools.Knowledge.Enabled
hasShared := a.cfg.Tools.SharedKnowledge.Enabled
if hasPrivate || hasShared {
b.WriteString("\n## Knowledge\n\n")
if hasPrivate {
b.WriteString("- **Privado:** habilitado\n")
}
if hasShared {
b.WriteString("- **Compartido:** habilitado\n")
}
}
// === Memoria ===
if a.cfg.Memory.Enabled {
b.WriteString("\n## Memoria\n\n")
fmt.Fprintf(&b, "- **Habilitada:** si\n")
fmt.Fprintf(&b, "- **Window size:** %d mensajes\n", a.windowSize)
}
// === Schedules ===
if len(a.cfg.Schedules) > 0 {
b.WriteString("\n## Schedules\n\n")
fmt.Fprintf(&b, "- **Cron jobs:** %d configurados\n", len(a.cfg.Schedules))
}
// === Uptime ===
uptime := time.Since(a.startTime).Round(time.Second)
b.WriteString("\n## Uptime\n\n")
fmt.Fprintf(&b, "- **Activo desde:** %s\n", uptime)
return b.String()
}