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>
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
// 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/pkg/decision"
|
||||
)
|
||||
|
||||
// Rules returns the decision rules for the asistente-2 bot.
|
||||
func Rules() []decision.Rule {
|
||||
return []decision.Rule{
|
||||
// !help — explicit help command
|
||||
{
|
||||
Name: "help",
|
||||
Match: decision.MatchCommand("help"),
|
||||
Actions: []decision.Action{{
|
||||
Kind: decision.ActionKindReply,
|
||||
Reply: &decision.ReplyAction{
|
||||
Content: "Soy asistente-2. Puedo responder preguntas y además consultar la hora actual.\n" +
|
||||
"- Pregúntame cualquier cosa\n" +
|
||||
"- Puedo decirte la fecha y hora actual\n\n" +
|
||||
"Escríbeme directamente lo que necesitas.",
|
||||
},
|
||||
}},
|
||||
},
|
||||
|
||||
// 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{},
|
||||
}},
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,280 @@
|
||||
# ============================================
|
||||
# IDENTIDAD
|
||||
# ============================================
|
||||
agent:
|
||||
id: asistente-2
|
||||
name: "Asistente 2"
|
||||
version: "1.0.0"
|
||||
enabled: true
|
||||
description: "Asistente con herramientas. Puede responder preguntas y consultar la hora actual."
|
||||
tags: [assistant, llm, tools]
|
||||
|
||||
# ============================================
|
||||
# PERSONALIDAD Y COMPORTAMIENTO
|
||||
# ============================================
|
||||
personality:
|
||||
tone: friendly
|
||||
verbosity: concise
|
||||
language: es
|
||||
languages_supported: [es, en]
|
||||
emoji_style: minimal
|
||||
prefix: "🛠️"
|
||||
error_style: helpful
|
||||
|
||||
templates:
|
||||
greeting: "Hola, soy asistente-2. ¿En qué puedo ayudarte?"
|
||||
unknown_command: "No entiendo ese comando. Escríbeme directamente lo que necesitas."
|
||||
permission_denied: "No tengo permiso para hacer eso."
|
||||
error: "Algo salió mal: {{.Error}}"
|
||||
success: "{{.Summary}}"
|
||||
busy: "Procesando tu solicitud anterior, dame un momento..."
|
||||
|
||||
behavior:
|
||||
proactive: false
|
||||
ask_confirmation: false
|
||||
show_reasoning: false
|
||||
thread_replies: true
|
||||
typing_indicator: true
|
||||
acknowledge_receipt: false
|
||||
|
||||
# ============================================
|
||||
# LLM — CONEXIÓN Y RAZONAMIENTO
|
||||
# ============================================
|
||||
llm:
|
||||
primary:
|
||||
provider: openai
|
||||
model: gpt-4o
|
||||
api_key_env: OPENAI_API_KEY
|
||||
base_url: ""
|
||||
max_tokens: 4096
|
||||
temperature: 0.7
|
||||
|
||||
fallback:
|
||||
provider: ""
|
||||
model: ""
|
||||
api_key_env: ""
|
||||
base_url: ""
|
||||
max_tokens: 0
|
||||
temperature: 0
|
||||
|
||||
reasoning:
|
||||
system_prompt_file: "prompts/system.md"
|
||||
context_window: 16384
|
||||
memory_messages: 30
|
||||
|
||||
tool_use:
|
||||
enabled: true # herramientas HABILITADAS
|
||||
max_iterations: 5
|
||||
parallel_calls: false
|
||||
|
||||
rate_limit:
|
||||
requests_per_minute: 60
|
||||
tokens_per_minute: 200000
|
||||
concurrent_requests: 5
|
||||
|
||||
# ============================================
|
||||
# TOOLS — current_time habilitada
|
||||
# ============================================
|
||||
tools:
|
||||
ssh:
|
||||
enabled: false
|
||||
allowed_targets: []
|
||||
forbidden_commands: []
|
||||
timeout: 0s
|
||||
max_concurrent: 0
|
||||
require_confirmation: []
|
||||
|
||||
http:
|
||||
enabled: false
|
||||
allowed_domains: []
|
||||
timeout: 0s
|
||||
max_retries: 0
|
||||
|
||||
scripts:
|
||||
enabled: false
|
||||
scripts_dir: ""
|
||||
allowed: []
|
||||
timeout: 0s
|
||||
sandbox: false
|
||||
|
||||
file_ops:
|
||||
enabled: false
|
||||
allowed_paths: []
|
||||
read_only: true
|
||||
|
||||
mcp:
|
||||
enabled: false
|
||||
servers: []
|
||||
expose:
|
||||
port: 0
|
||||
tools: []
|
||||
|
||||
memory:
|
||||
enabled: true
|
||||
|
||||
# ============================================
|
||||
# MEMORIA — ventana de conversación + hechos
|
||||
# ============================================
|
||||
memory:
|
||||
enabled: true
|
||||
window_size: 30
|
||||
|
||||
# ============================================
|
||||
# MATRIX — CONEXIÓN Y ROOMS
|
||||
# ============================================
|
||||
matrix:
|
||||
homeserver: "https://matrix-af2f3d.organic-machine.com"
|
||||
user_id: "@asistente-2:matrix-af2f3d.organic-machine.com"
|
||||
access_token_env: MATRIX_TOKEN_ASISTENTE_2
|
||||
device_id: "XUGTSZJYFQ"
|
||||
|
||||
encryption:
|
||||
enabled: true
|
||||
store_path: "./agents/asistente-2/data/crypto/"
|
||||
pickle_key_env: PICKLE_KEY_ASISTENTE_2
|
||||
trust_mode: tofu
|
||||
recovery_key_env: SSSS_RECOVERY_KEY_ASISTENTE_2
|
||||
|
||||
rooms:
|
||||
listen: []
|
||||
respond: []
|
||||
admin: []
|
||||
|
||||
filters:
|
||||
command_prefix: "!"
|
||||
mention_respond: true
|
||||
dm_respond: true
|
||||
ignore_bots: true
|
||||
ignore_users: []
|
||||
min_power_level: 0
|
||||
|
||||
# ============================================
|
||||
# COMUNICACIÓN INTER-AGENTES
|
||||
# ============================================
|
||||
agents:
|
||||
peers:
|
||||
- id: assistant-bot
|
||||
capabilities: [general, llm]
|
||||
room: ""
|
||||
|
||||
delegation:
|
||||
enabled: false
|
||||
can_delegate_to: []
|
||||
can_receive_from: [assistant-bot]
|
||||
max_delegation_depth: 1
|
||||
timeout: 30s
|
||||
|
||||
protocol:
|
||||
format: json
|
||||
channel: matrix
|
||||
heartbeat_interval: 60s
|
||||
|
||||
# ============================================
|
||||
# SSH — no aplica para este bot
|
||||
# ============================================
|
||||
ssh:
|
||||
defaults:
|
||||
user: ""
|
||||
port: 22
|
||||
key_file_env: ""
|
||||
known_hosts: ""
|
||||
keepalive_interval: 0s
|
||||
timeout: 0s
|
||||
targets: {}
|
||||
|
||||
# ============================================
|
||||
# PERMISOS Y SEGURIDAD
|
||||
# ============================================
|
||||
security:
|
||||
roles:
|
||||
admin:
|
||||
users: ["@admin:matrix-af2f3d.organic-machine.com"]
|
||||
actions: ["*"]
|
||||
user:
|
||||
users: ["*"]
|
||||
actions: ["ask", "help", "summarize"]
|
||||
|
||||
audit:
|
||||
enabled: false
|
||||
log_file: "./agents/asistente-2/data/audit.log"
|
||||
log_to_room: ""
|
||||
include: []
|
||||
|
||||
secrets:
|
||||
provider: env
|
||||
|
||||
# ============================================
|
||||
# SCHEDULING — sin tareas automáticas
|
||||
# ============================================
|
||||
schedules: []
|
||||
|
||||
# ============================================
|
||||
# OBSERVABILIDAD
|
||||
# ============================================
|
||||
observability:
|
||||
logging:
|
||||
level: info
|
||||
format: json
|
||||
output: stdout
|
||||
file: "./agents/asistente-2/data/asistente-2.log"
|
||||
|
||||
metrics:
|
||||
enabled: false
|
||||
port: 9092
|
||||
path: /metrics
|
||||
export: prometheus
|
||||
|
||||
health:
|
||||
enabled: true
|
||||
port: 8082
|
||||
path: /healthz
|
||||
|
||||
tracing:
|
||||
enabled: false
|
||||
provider: ""
|
||||
endpoint: ""
|
||||
|
||||
# ============================================
|
||||
# RESILIENCIA
|
||||
# ============================================
|
||||
resilience:
|
||||
circuit_breaker:
|
||||
failure_threshold: 5
|
||||
timeout: 30s
|
||||
half_open_max: 2
|
||||
|
||||
retry:
|
||||
max_attempts: 2
|
||||
backoff: exponential
|
||||
initial_delay: 1s
|
||||
max_delay: 10s
|
||||
|
||||
shutdown:
|
||||
timeout: 10s
|
||||
drain_messages: true
|
||||
save_state: false
|
||||
state_file: ""
|
||||
|
||||
queue:
|
||||
enabled: true
|
||||
max_size: 100
|
||||
priority_users: ["@admin:matrix-af2f3d.organic-machine.com"]
|
||||
|
||||
# ============================================
|
||||
# ALMACENAMIENTO Y ESTADO
|
||||
# ============================================
|
||||
storage:
|
||||
state:
|
||||
backend: sqlite
|
||||
path: "./agents/asistente-2/data/asistente-2.db"
|
||||
|
||||
cache:
|
||||
enabled: true
|
||||
backend: memory
|
||||
ttl: 5m
|
||||
max_entries: 200
|
||||
|
||||
history:
|
||||
backend: sqlite
|
||||
path: "./agents/asistente-2/data/history.db"
|
||||
retention: 168h # 7 días
|
||||
@@ -0,0 +1,24 @@
|
||||
# Asistente 2 — System Prompt
|
||||
|
||||
Eres un asistente conversacional amigable y directo. Operas en Matrix, respondiendo mensajes directos (DMs) y menciones en rooms.
|
||||
|
||||
## Capacidades
|
||||
- Responder preguntas generales
|
||||
- Resumir texto o documentos pegados en el chat
|
||||
- Redactar textos, emails, documentación
|
||||
- Explicar conceptos técnicos y no técnicos
|
||||
- Ayudar con código: revisar, corregir, explicar
|
||||
- **Consultar la hora y fecha actual** usando la herramienta `current_time`
|
||||
|
||||
## Herramientas disponibles
|
||||
- `current_time`: Devuelve la fecha y hora actual del servidor. Úsala cuando alguien pregunte por la hora, fecha, o necesites contexto temporal.
|
||||
|
||||
## Estilo
|
||||
- Respuestas concisas por defecto. Si necesitas extensión, pregunta primero.
|
||||
- Usa markdown cuando ayude a la legibilidad (listas, código, headers)
|
||||
- Idioma principal: español. Cambia al idioma del usuario si escribe en otro.
|
||||
- Sin emojis excesivos. Uno o dos si aportan contexto.
|
||||
|
||||
## Uso de herramientas
|
||||
- Cuando alguien pregunte por la hora o fecha, usa `current_time` antes de responder.
|
||||
- No inventes datos temporales; siempre consulta la herramienta.
|
||||
Reference in New Issue
Block a user