chore: auto-commit (27 archivos)
- .claude/CLAUDE.md - .claude/rules/create_agent.md - agents/_specials/father-bot/prompts/system.md - agents/_template/config.yaml - agents/_template_robot/config.yaml - cmd/agentctl/autoavatar.go - cmd/launcher/sqlite.go - dev-scripts/_common.sh - dev-scripts/agent/create-full.sh - dev-scripts/agent/delete-full.sh - ... Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -29,7 +29,8 @@
|
||||
#
|
||||
# Flags de personalización (opcionales, activan el Paso 8 automático):
|
||||
# --description "<texto>" descripcion del agente
|
||||
# --provider <openai|anthropic|...> proveedor LLM (default: auto-detect)
|
||||
# --provider <claude-code|openai|anthropic> proveedor LLM (default: claude-code)
|
||||
# REGLA PROYECTO: usar claude-code SIEMPRE salvo razon explicita
|
||||
# --model <modelo> modelo LLM (default: segun provider)
|
||||
# --tone <friendly|professional|...> tono (default: friendly)
|
||||
# --prefix "<emoji>" emoji prefix (default: 🤖)
|
||||
@@ -37,6 +38,8 @@
|
||||
# --system-prompt-file <path> system prompt desde archivo
|
||||
# --tool-use habilitar tool_use en config
|
||||
# --language <es|en> idioma (default: es)
|
||||
# --avatar <URL_o_ruta> imagen para el avatar (default: generador random)
|
||||
# ej: https://example/pikachu.png o ./avatars/poke.png
|
||||
#
|
||||
# Requisitos en .env:
|
||||
# MATRIX_ADMIN_TOKEN, MATRIX_HOMESERVER, MATRIX_SERVER_NAME
|
||||
@@ -88,10 +91,15 @@ while [[ $# -gt 0 ]]; do
|
||||
--tool-use) PERSONALIZE_TOOL_USE=true; DO_PERSONALIZE=true; shift ;;
|
||||
--language) PERSONALIZE_LANGUAGE="${2:-es}"; DO_PERSONALIZE=true; shift 2 ;;
|
||||
--language=*) PERSONALIZE_LANGUAGE="${1#--language=}"; DO_PERSONALIZE=true; shift ;;
|
||||
--avatar) AVATAR_SOURCE="${2:-}"; shift 2 ;;
|
||||
--avatar=*) AVATAR_SOURCE="${1#--avatar=}"; shift ;;
|
||||
*) shift ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# AVATAR_SOURCE puede ser URL (http/https) o ruta local. Vacio = generador random.
|
||||
: "${AVATAR_SOURCE:=}"
|
||||
|
||||
if [[ "$TYPE" == "robot" ]]; then
|
||||
TYPE_LABEL="robot"
|
||||
TYPE_EMOJI="🤖"
|
||||
@@ -165,22 +173,34 @@ if [[ "$TYPE" == "robot" ]]; then
|
||||
echo ""
|
||||
fi
|
||||
|
||||
# ── Paso auto-avatar: Generar avatar automatico ─────────────────────────
|
||||
# ── Paso auto-avatar: Generar/aplicar avatar ────────────────────────────
|
||||
AVATAR_STEP=$((TOTAL_STEPS - 2))
|
||||
info "Paso ${AVATAR_STEP}/${TOTAL_STEPS} — Generando avatar automatico..."
|
||||
info "Paso ${AVATAR_STEP}/${TOTAL_STEPS} — Configurando avatar del bot..."
|
||||
echo ""
|
||||
|
||||
# Resuelve el binario de agentctl
|
||||
# Resuelve el binario de agentctl como array (preserva split por espacios)
|
||||
if [[ -f "$REPO_ROOT/bin/agentctl" ]]; then
|
||||
CTL="$REPO_ROOT/bin/agentctl"
|
||||
CTL_ARR=("$REPO_ROOT/bin/agentctl")
|
||||
else
|
||||
CTL="$GO run -tags goolm ./cmd/agentctl"
|
||||
CTL_ARR=("$GO" run -tags goolm ./cmd/agentctl)
|
||||
fi
|
||||
|
||||
if $CTL auto-avatar "$ID" 2>&1; then
|
||||
ok "Avatar generado y aplicado"
|
||||
# Si el usuario pasa --avatar, usa la URL/ruta indicada en vez del generador random.
|
||||
AVATAR_CMD=("${CTL_ARR[@]}" auto-avatar "$ID")
|
||||
if [[ -n "$AVATAR_SOURCE" ]]; then
|
||||
if [[ "$AVATAR_SOURCE" =~ ^https?:// ]]; then
|
||||
AVATAR_CMD+=(--from-url "$AVATAR_SOURCE")
|
||||
info "Usando avatar personalizado desde URL: $AVATAR_SOURCE"
|
||||
else
|
||||
AVATAR_CMD+=(--from-file "$AVATAR_SOURCE")
|
||||
info "Usando avatar personalizado desde archivo: $AVATAR_SOURCE"
|
||||
fi
|
||||
fi
|
||||
|
||||
if "${AVATAR_CMD[@]}" 2>&1; then
|
||||
ok "Avatar configurado y aplicado"
|
||||
else
|
||||
warn "No se pudo generar avatar automatico (se puede hacer despues con: agentctl auto-avatar $ID)"
|
||||
warn "No se pudo configurar avatar (se puede hacer despues con: agentctl auto-avatar $ID [--from-url <url> | --from-file <path>])"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
@@ -213,6 +233,21 @@ fi
|
||||
|
||||
echo ""
|
||||
|
||||
# ── Paso 8a (robots): aplicar --description al config.yaml ──────────────
|
||||
# Los robots no tienen prompts/system.md ni agent.go (no LLM), pero su
|
||||
# config.yaml SI tiene un campo `description:` que personalize.sh ignora.
|
||||
# Para evitar que el robot quede con la descripcion del template literal,
|
||||
# parcheamos la linea aqui.
|
||||
if [[ "$TYPE" == "robot" ]] && [[ -n "$PERSONALIZE_DESCRIPTION" ]]; then
|
||||
CFG_FILE="agents/$ID/config.yaml"
|
||||
if [[ -f "$CFG_FILE" ]]; then
|
||||
# Escapar caracteres especiales del valor para sed
|
||||
ESCAPED_DESC="$(printf '%s' "$PERSONALIZE_DESCRIPTION" | sed -e 's/[\/&|]/\\&/g')"
|
||||
sed -i "0,/^ description:.*/s|| description: \"$ESCAPED_DESC\"|" "$CFG_FILE"
|
||||
ok "Descripcion del robot aplicada al config.yaml"
|
||||
fi
|
||||
fi
|
||||
|
||||
# ── Paso 8 (automático, solo agents): Personalizar archivos ─────────────
|
||||
PERSONALIZE_DONE=false
|
||||
if $DO_PERSONALIZE && [[ "$TYPE" != "robot" ]]; then
|
||||
|
||||
Reference in New Issue
Block a user